{"action":"opened","issue":{"url":"https://api.github.com/repos/code-cracker/code-cracker/issues/810","repository_url":"https://api.github.com/repos/code-cracker/code-cracker","labels_url":"https://api.github.com/repos/code-cracker/code-cracker/issues/810/labels{/name}","comments_url":"https://api.github.com/repos/code-cracker/code-cracker/issues/810/comments","events_url":"https://api.github.com/repos/code-cracker/code-cracker/issues/810/events","html_url":"https://github.com/code-cracker/code-cracker/issues/810","id":169811824,"number":810,"title":"Bug: ArgumentNullException on CallExtensionMethodAsExtensionAnalyzer (CC0026)","user":{"login":"giggio","id":334958,"avatar_url":"https://avatars.githubusercontent.com/u/334958?v=3","gravatar_id":"","url":"https://api.github.com/users/giggio","html_url":"https://github.com/giggio","followers_url":"https://api.github.com/users/giggio/followers","following_url":"https://api.github.com/users/giggio/following{/other_user}","gists_url":"https://api.github.com/users/giggio/gists{/gist_id}","starred_url":"https://api.github.com/users/giggio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giggio/subscriptions","organizations_url":"https://api.github.com/users/giggio/orgs","repos_url":"https://api.github.com/users/giggio/repos","events_url":"https://api.github.com/users/giggio/events{/privacy}","received_events_url":"https://api.github.com/users/giggio/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/code-cracker/code-cracker/labels/1%20-%20Ready","name":"1 - Ready","color":"CCCCCC"},{"url":"https://api.github.com/repos/code-cracker/code-cracker/labels/analyzer","name":"analyzer","color":"0052cc"},{"url":"https://api.github.com/repos/code-cracker/code-cracker/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/code-cracker/code-cracker/labels/C%23","name":"C#","color":"5319e7"},{"url":"https://api.github.com/repos/code-cracker/code-cracker/labels/up-for-grabs","name":"up-for-grabs","color":"006b75"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/code-cracker/code-cracker/milestones/16","html_url":"https://github.com/code-cracker/code-cracker/milestones/1.0.1","labels_url":"https://api.github.com/repos/code-cracker/code-cracker/milestones/16/labels","id":1711860,"number":16,"title":"1.0.1","description":"","creator":{"login":"giggio","id":334958,"avatar_url":"https://avatars.githubusercontent.com/u/334958?v=3","gravatar_id":"","url":"https://api.github.com/users/giggio","html_url":"https://github.com/giggio","followers_url":"https://api.github.com/users/giggio/followers","following_url":"https://api.github.com/users/giggio/following{/other_user}","gists_url":"https://api.github.com/users/giggio/gists{/gist_id}","starred_url":"https://api.github.com/users/giggio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giggio/subscriptions","organizations_url":"https://api.github.com/users/giggio/orgs","repos_url":"https://api.github.com/users/giggio/repos","events_url":"https://api.github.com/users/giggio/events{/privacy}","received_events_url":"https://api.github.com/users/giggio/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":3,"state":"open","created_at":"2016-04-17T04:05:44Z","updated_at":"2016-08-07T19:28:13Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2016-08-07T19:28:13Z","updated_at":"2016-08-07T19:28:13Z","closed_at":null,"body":"This will cause a `ArgumentNullException` in `CallExtensionMethodAsExtensionAnalyzer`, because the method `M` is supposed to have arguments.\r\n\r\n````csharp\r\n    class Foo\r\n    {\r\n        public static void N()\r\n        {\r\n            Exts.M();\r\n        }\r\n    }\r\n    static class Exts\r\n    {\r\n        public static void M(this string s) => s.ToString();\r\n    }\r\n````\r\n\r\nThis is the full error output:\r\n\r\n````\r\nAnalyzer 'CodeCracker.CSharp.Usage.CallExtensionMethodAsExtensionAnalyzer' threw an exception of type 'System.ArgumentNullException' with message 'Value cannot be null.\r\nParameter name: expression'.\tConsoleApplication4\t\t1\t1\tIntelliSense\tActive\tAnalyzer 'CodeCracker.CSharp.Usage.CallExtensionMethodAsExtensionAnalyzer' threw the following exception:\r\n'Exception occurred with following context:\r\nCompilation: ConsoleApplication4\r\nSyntaxTree: C:\\p\\rabiscos\\ConsoleApplication4\\ConsoleApplication4\\Program.cs\r\nSyntaxNode: Exts.M() [InvocationExpressionSyntax]@[288..296) (20,8)-(20,16)\r\n\r\nSystem.ArgumentNullException: Value cannot be null.\r\nParameter name: expression\r\n   at Microsoft.CodeAnalysis.CSharp.SyntaxFactory.MemberAccessExpression(SyntaxKind kind, ExpressionSyntax expression, SyntaxToken operatorToken, SimpleNameSyntax name)\r\n   at Microsoft.CodeAnalysis.CSharp.SyntaxFactory.MemberAccessExpression(SyntaxKind kind, ExpressionSyntax expression, SimpleNameSyntax name)\r\n   at CodeCracker.CSharp.Usage.CallExtensionMethodAsExtensionAnalyzer.CreateInvocationExpression(ExpressionSyntax sourceExpression, SimpleNameSyntax methodName, ArgumentListSyntax argumentList) in C:\\p\\code-cracker\\src\\CSharp\\CodeCracker\\Usage\\CallExtensionMethodAsExtensionAnalyzer.cs:line 106\r\n   at CodeCracker.CSharp.Usage.CallExtensionMethodAsExtensionAnalyzer.IsSelectingADifferentMethod(IEnumerable`1 childNodes, SimpleNameSyntax methodName, SyntaxTree tree, IMethodSymbol methodSymbol, ExpressionSyntax invocationExpression, Compilation compilation) in C:\\p\\code-cracker\\src\\CSharp\\CodeCracker\\Usage\\CallExtensionMethodAsExtensionAnalyzer.cs:line 63\r\n   at CodeCracker.CSharp.Usage.CallExtensionMethodAsExtensionAnalyzer.AnalyzeInvocation(SyntaxNodeAnalysisContext context, Compilation compilation) in C:\\p\\code-cracker\\src\\CSharp\\CodeCracker\\Usage\\CallExtensionMethodAsExtensionAnalyzer.cs:line 54\r\n   at CodeCracker.CSharp.Usage.CallExtensionMethodAsExtensionAnalyzer.<>c__DisplayClass7_0.<AnalyzeCompilation>b__0(SyntaxNodeAnalysisContext context) in C:\\p\\code-cracker\\src\\CSharp\\CodeCracker\\Usage\\CallExtensionMethodAsExtensionAnalyzer.cs:line 36\r\n   at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass42_1`1.<ExecuteSyntaxNodeAction>b__1()\r\n   at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock(DiagnosticAnalyzer analyzer, Action analyze, Nullable`1 info)\r\n-----\r\n'.\r\n````\r\n\r\nThe PR should pull into the `v1.0.x` branch."}}
{"actor":{"display_login":"giggio"}}