{"action":"opened","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/5170","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/5170/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/5170/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/5170/events","html_url":"https://github.com/dotnet/roslyn/issues/5170","id":106065912,"number":5170,"title":"Assert failure from MemberSemanticModel.GetLambdaParameterSymbol","user":{"login":"balajikris","id":4213867,"avatar_url":"https://avatars.githubusercontent.com/u/4213867?v=3","gravatar_id":"","url":"https://api.github.com/users/balajikris","html_url":"https://github.com/balajikris","followers_url":"https://api.github.com/users/balajikris/followers","following_url":"https://api.github.com/users/balajikris/following{/other_user}","gists_url":"https://api.github.com/users/balajikris/gists{/gist_id}","starred_url":"https://api.github.com/users/balajikris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balajikris/subscriptions","organizations_url":"https://api.github.com/users/balajikris/orgs","repos_url":"https://api.github.com/users/balajikris/repos","events_url":"https://api.github.com/users/balajikris/events{/privacy}","received_events_url":"https://api.github.com/users/balajikris/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-11T18:26:06Z","updated_at":"2015-09-11T18:26:06Z","closed_at":null,"body":"Split bug 2 of 2 from #4918\r\n\r\n```C#\r\nusing System.Linq;\r\nusing System.Text;\r\n\r\npublic static class LazyToStringExtension\r\n{\r\n    public static string LazyToString<T>(this T obj) where T : class\r\n    {\r\n        StringBuilder sb = new StringBuilder();\r\n        typeof(T)\r\n            .GetProperties(System.Reflection.BindingFlags.Public)\r\n            .Select($$x => x.GetValue(obj))\r\n    }\r\n}\r\n```\r\nWith caret at `$$`, either to the left or right of `x`, we get an assert failure.\r\n\r\n~~~\r\nDebug.Assert(this.GetMemberModel(lambda) == null,  \"Did not find a \r\nunique LambdaSymbol for lambda in member.\");\r\n~~~\r\n\r\n ~~~\t\r\nMicrosoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.MemberSemanticModel.GetLambdaParameterSymbol(Microsoft.CodeAnalysis.CSharp.Syntax.ParameterSyntax parameter, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax lambda, System.Threading.CancellationToken cancellationToken) Line 598\tC#\r\n \tMicrosoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.MemberSemanticModel.GetLambdaParameterSymbol(Microsoft.CodeAnalysis.CSharp.Syntax.ParameterSyntax parameter, System.Threading.CancellationToken cancellationToken) Line 558\tC#\r\n \tMicrosoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.MemberSemanticModel.GetDeclaredSymbol(Microsoft.CodeAnalysis.CSharp.Syntax.ParameterSyntax declarationSyntax, System.Threading.CancellationToken cancellationToken) Line 540\tC#\r\n \tMicrosoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.SyntaxTreeSemanticModel.GetDeclaredSymbol(Microsoft.CodeAnalysis.CSharp.Syntax.ParameterSyntax declarationSyntax, System.Threading.CancellationToken cancellationToken) Line 1813\tC#\r\n \tMicrosoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.GetDeclaredSymbolCore(Microsoft.CodeAnalysis.SyntaxNode declaration, System.Threading.CancellationToken cancellationToken) Line 4469\tC#\r\n \tMicrosoft.CodeAnalysis.dll!Microsoft.CodeAnalysis.SemanticModel.GetDeclaredSymbolForNode(Microsoft.CodeAnalysis.SyntaxNode declaration, System.Threading.CancellationToken cancellationToken) Line 358\tC#\r\n \tMicrosoft.CodeAnalysis.dll!Microsoft.CodeAnalysis.ModelExtensions.GetDeclaredSymbol(Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.SyntaxNode declaration, System.Threading.CancellationToken cancellationToken) Line 135\tC#\r\n \tMicrosoft.CodeAnalysis.CSharp.Workspaces.dll!Microsoft.CodeAnalysis.CSharp.CSharpSemanticFactsService.GetDeclaredSymbol.AnonymousMethod__0(Microsoft.CodeAnalysis.SyntaxNode node) Line 130\tC#\r\n \tSystem.Core.dll!System.Linq.Enumerable.WhereSelectEnumerableIterator<Microsoft.CodeAnalysis.SyntaxNode, <>f__AnonymousType3<Microsoft.CodeAnalysis.SyntaxNode, Microsoft.CodeAnalysis.ISymbol>>.MoveNext() Line 285\tC#\r\n \tSystem.Core.dll!System.Linq.Enumerable.WhereSelectEnumerableIterator<<>f__AnonymousType3<Microsoft.CodeAnalysis.SyntaxNode, Microsoft.CodeAnalysis.ISymbol>, Microsoft.CodeAnalysis.ISymbol>.MoveNext() Line 282\tC#\r\n \tSystem.Core.dll!System.Linq.Enumerable.FirstOrDefault<Microsoft.CodeAnalysis.ISymbol>(System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ISymbol> source) Line 950\tC#\r\n \tMicrosoft.CodeAnalysis.CSharp.Workspaces.dll!Microsoft.CodeAnalysis.CSharp.CSharpSemanticFactsService.GetDeclaredSymbol(Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.SyntaxToken token, System.Threading.CancellationToken cancellationToken) Line 134\tC#\r\n \tMicrosoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.Shared.Extensions.SemanticModelExtensions.GetSymbolsEnumerable(Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.LanguageServices.ISemanticFactsService semanticFacts, Microsoft.CodeAnalysis.LanguageServices.ISyntaxFactsService syntaxFacts, Microsoft.CodeAnalysis.SyntaxToken token, bool bindLiteralsToUnderlyingType, System.Threading.CancellationToken cancellationToken) Line 112\tC#\r\n \tSystem.Core.dll!System.Linq.Enumerable.WhereSelectEnumerableIterator<Microsoft.CodeAnalysis.ISymbol, Microsoft.CodeAnalysis.ISymbol>.MoveNext() Line 282\tC#\r\n \tSystem.Core.dll!System.Linq.Enumerable.FirstOrDefault<Microsoft.CodeAnalysis.ISymbol>(System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ISymbol> source) Line 950\tC#\r\n \tMicrosoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.FindSymbols.SymbolFinder.FindSymbolAtPosition(Microsoft.CodeAnalysis.SemanticModel semanticModel, int position, Microsoft.CodeAnalysis.Workspace workspace, bool bindLiteralsToUnderlyingType, System.Threading.CancellationToken cancellationToken) Line 48\tC#\r\n \tMicrosoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.FindSymbols.SymbolFinder.FindSymbolAtPosition(Microsoft.CodeAnalysis.SemanticModel semanticModel, int position, Microsoft.CodeAnalysis.Workspace workspace, System.Threading.CancellationToken cancellationToken) Line 30\tC#\r\n \tMicrosoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting.AbstractDocumentHighlightsService.GetDocumentHighlightsAsync(Microsoft.CodeAnalysis.Document document, int position, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Document> documentsToSearch, System.Threading.CancellationToken cancellationToken) Line 25\tC#\r\n \tMicrosoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting.ReferenceHighlightingViewTaggerProvider.ProduceTagsAsync(Microsoft.CodeAnalysis.Editor.Tagging.TaggerContext<Microsoft.CodeAnalysis.Editor.Shared.Tagging.NavigableHighlightTag> context, Microsoft.VisualStudio.Text.SnapshotPoint position, Microsoft.CodeAnalysis.Workspace workspace, Microsoft.CodeAnalysis.Document document) Line 139\tC#\r\n \tMicrosoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Implementation.ReferenceHighlighting.ReferenceHighlightingViewTaggerProvider.ProduceTagsAsync(Microsoft.CodeAnalysis.Editor.Tagging.TaggerContext<Microsoft.CodeAnalysis.Editor.Shared.Tagging.NavigableHighlightTag> context) Line 114\tC#\r\n \tMicrosoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Tagging.AbstractAsynchronousTaggerProvider<Microsoft.CodeAnalysis.Editor.Shared.Tagging.NavigableHighlightTag>.TagSource.ProduceTagsAsync(Microsoft.CodeAnalysis.Editor.Tagging.TaggerContext<Microsoft.CodeAnalysis.Editor.Shared.Tagging.NavigableHighlightTag> context) Line 570\tC#\r\n \tMicrosoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Tagging.AbstractAsynchronousTaggerProvider<Microsoft.CodeAnalysis.Editor.Shared.Tagging.NavigableHighlightTag>.TagSource.RecomputeTagsAsync(object oldState, Microsoft.VisualStudio.Text.SnapshotPoint? caretPosition, Microsoft.CodeAnalysis.Text.TextChangeRange? textChangeRange, System.Collections.Generic.List<Microsoft.CodeAnalysis.Editor.DocumentSnapshotSpan> spansToTag, System.Collections.Immutable.ImmutableDictionary<Microsoft.VisualStudio.Text.ITextBuffer, Microsoft.CodeAnalysis.Editor.Shared.Tagging.TagSpanIntervalTree<Microsoft.CodeAnalysis.Editor.Shared.Tagging.NavigableHighlightTag>> oldTagTrees, System.Threading.CancellationToken cancellationToken) Line 553\tC#\r\n \tMicrosoft.CodeAnalysis.EditorFeatures.dll!Microsoft.CodeAnalysis.Editor.Tagging.AbstractAsynchronousTaggerProvider<Microsoft.CodeAnalysis.Editor.Shared.Tagging.NavigableHighlightTag>.TagSource.RecomputeTagsForeground.AnonymousMethod__0(System.Threading.CancellationToken ct) Line 294\tC#\r\n~~~"}}