This project is read-only.
1

Resolved

VB xml-doc-comment crashes when use reserved keyword for formal type parameter

description

Look at this code:
''' <summary>
''' <see cref="C(Of Integer).f()"/>
''' </summary>
Class C(Of T)
    Sub f()
    End Sub
End Class
What I expect: an error report, because what goes into the cref should be a formal type parameter not a reserved keyword.

What I get: an exception

System.InvalidOperationException: Unexpected value 'PredefinedType' of type 'Microsoft.CodeAnalysis.VisualBasic.SyntaxKind'
at Microsoft.CodeAnalysis.VisualBasic.DocumentationCommentCrefBinder.CreateTypeParameterSymbolsAndConstructSymbols(GenericNameSyntax genericName, ArrayBuilder1 symbols, Dictionary2 typeParameters) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\VisualBasic\Portable\Binding\DocumentationCommentCrefBinder.vb:line 838
at Microsoft.CodeAnalysis.VisualBasic.DocumentationCommentCrefBinder.CollectSimpleNameSymbolsStrict(SimpleNameSyntax node, Dictionary2 typeParameters, ArrayBuilder1 symbols, Boolean preserveAlias, HashSet1& useSiteDiagnostics, Boolean typeOrNamespaceOnly) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\VisualBasic\Portable\Binding\DocumentationCommentCrefBinder.vb:line 544
at Microsoft.CodeAnalysis.VisualBasic.DocumentationCommentCrefBinder.CollectQualifiedNameSymbolsStrict(QualifiedNameSyntax node, Dictionary
2 typeParameters, ArrayBuilder1 symbols, Boolean preserveAlias, HashSet1& useSiteDiagnostics) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\VisualBasic\Portable\Binding\DocumentationCommentCrefBinder.vb:line 582
at Microsoft.CodeAnalysis.VisualBasic.DocumentationCommentCrefBinder.CollectCrefNameSymbolsStrict(TypeSyntax nameFromCref, Int32 argsCount, Dictionary2 typeParameters, ArrayBuilder1 symbols, Boolean preserveAlias, HashSet1& useSiteDiagnostics) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\VisualBasic\Portable\Binding\DocumentationCommentCrefBinder.vb:line 508
at Microsoft.CodeAnalysis.VisualBasic.DocumentationCommentCrefBinder.BindInsideCrefReferenceName(TypeSyntax name, Int32 argCount, Boolean preserveAliases, HashSet
1& useSiteDiagnostics) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\VisualBasic\Portable\Binding\DocumentationCommentCrefBinder.vb:line 373
at Microsoft.CodeAnalysis.VisualBasic.DocumentationCommentCrefBinder.BindInsideCrefAttributeValue(TypeSyntax name, Boolean preserveAliases, DiagnosticBag diagnosticBag, HashSet1& useSiteDiagnostics) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\VisualBasic\Portable\Binding\DocumentationCommentCrefBinder.vb:line 209
at Microsoft.CodeAnalysis.VisualBasic.Binder.BindInsideCrefAttributeValue(TypeSyntax name, Boolean preserveAliases, DiagnosticBag diagnosticBag, HashSet
1& useSiteDiagnostics) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\VisualBasic\Portable\Binding\Binder_DocumentationComments.vb:line 13
at Microsoft.CodeAnalysis.VisualBasic.SyntaxTreeSemanticModel.GetCrefOrNameAttributeReferenceSymbols(VisualBasicSyntaxNode node, Boolean preserveAlias, ImmutableArray1& typeParameters) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\VisualBasic\Portable\Compilation\SyntaxTreeSemanticModel.vb:line 584
at Microsoft.CodeAnalysis.VisualBasic.SyntaxTreeSemanticModel.GetSymbolInfoForCrefOrNameAttributeReference(VisualBasicSyntaxNode node, SymbolInfoOptions options) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\VisualBasic\Portable\Compilation\SyntaxTreeSemanticModel.vb:line 452
at Microsoft.CodeAnalysis.VisualBasic.SyntaxTreeSemanticModel.GetExpressionSymbolInfo(ExpressionSyntax node, SymbolInfoOptions options, CancellationToken cancellationToken) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\VisualBasic\Portable\Compilation\SyntaxTreeSemanticModel.vb:line 242
at Microsoft.CodeAnalysis.VisualBasic.VBSemanticModel.GetSymbolInfo(ExpressionSyntax expression, CancellationToken cancellationToken) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\VisualBasic\Portable\Compilation\SemanticModel.vb:line 154
at Microsoft.CodeAnalysis.VisualBasic.VBSemanticModel.GetSymbolInfoForNode(SyntaxNode node, CancellationToken cancellationToken) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\VisualBasic\Portable\Compilation\SemanticModel.vb:line 3067
at Microsoft.CodeAnalysis.VisualBasic.VBSemanticModel.GetSymbolInfoCore(SyntaxNode node, CancellationToken cancellationToken) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\VisualBasic\Portable\Compilation\SemanticModel.vb:line 3158
at Microsoft.CodeAnalysis.Simplification.SimplificationHelpers.GetOriginalSymbolInfo(SemanticModel semanticModel, SyntaxNode expression) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Workspaces\Core\Portable\Simplification\SimplificationHelpers.cs:line 88
at Microsoft.CodeAnalysis.VisualBasic.Extensions.ExpressionSyntaxExtensions.TryReduce(NameSyntax name, SemanticModel semanticModel, ExpressionSyntax& replacementNode, TextSpan& issueSpan, OptionSet optionSet, CancellationToken cancellationToken) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Workspaces\VisualBasic\Portable\Extensions\ExpressionSyntaxExtensions.vb:line 1161
at Microsoft.CodeAnalysis.VisualBasic.Extensions.ExpressionSyntaxExtensions.TryReduceExplicitName(ExpressionSyntax expression, SemanticModel semanticModel, ExpressionSyntax& replacementNode, TextSpan& issueSpan, OptionSet optionSet, CancellationToken cancellationToken) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Workspaces\VisualBasic\Portable\Extensions\ExpressionSyntaxExtensions.vb:line 937
at Microsoft.CodeAnalysis.VisualBasic.Extensions.ExpressionSyntaxExtensions.TryReduceOrSimplifyExplicitName(ExpressionSyntax expression, SemanticModel semanticModel, ExpressionSyntax& replacementNode, TextSpan& issueSpan, OptionSet optionSet, CancellationToken cancellationToken) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Workspaces\VisualBasic\Portable\Extensions\ExpressionSyntaxExtensions.vb:line 910
at Microsoft.CodeAnalysis.VisualBasic.CodeFixes.SimplifyTypeNames.VisualBasicSimplifyTypeNamesDiagnosticAnalyzer.CanSimplifyTypeNameExpression(SemanticModel model, SyntaxNode node, OptionSet optionSet, TextSpan& issueSpan, String& diagnosticId, CancellationToken cancellationToken) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Closed\Features\VisualBasic\Diagnostics\Analyzers\VisualBasicSimplifyTypeNamesDiagnosticAnalyzer.vb:line 70
at Microsoft.CodeAnalysis.VisualBasic.CodeFixes.SimplifyTypeNames.VisualBasicSimplifyTypeNamesDiagnosticAnalyzer.CanSimplifyTypeNameExpressionCore(SemanticModel model, SyntaxNode node, OptionSet optionSet, TextSpan& issueSpan, String& diagnosticId, CancellationToken cancellationToken) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Closed\Features\VisualBasic\Diagnostics\Analyzers\VisualBasicSimplifyTypeNamesDiagnosticAnalyzer.vb:line 58
at Microsoft.CodeAnalysis.Diagnostics.SimplifyTypeNames.SimplifyTypeNamesDiagnosticAnalyzerBase
1.TrySimplifyTypeNameExpression(SemanticModel model, SyntaxNode node, AnalyzerOptions analyzerOptions, Diagnostic& diagnostic, CancellationToken cancellationToken) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Closed\Features\Core\Diagnostics\Analyzers\SimplifyTypeNamesDiagnosticAnalyzerBase.cs:line 79
at Microsoft.CodeAnalysis.VisualBasic.CodeFixes.SimplifyTypeNames.VisualBasicSimplifyTypeNamesDiagnosticAnalyzer._Closure$__1._Lambda$__4(SyntaxNode n) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Closed\Features\VisualBasic\Diagnostics\Analyzers\VisualBasicSimplifyTypeNamesDiagnosticAnalyzer.vb:line 34
at Microsoft.CodeAnalysis.SyntaxNode.ChildSyntaxListEnumeratorStack..ctor(SyntaxNode startingNode, Func2 descendIntoChildren) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\Core\Portable\Syntax\SyntaxNode.Iterators.cs:line 50
at Microsoft.CodeAnalysis.SyntaxNode.ThreeEnumeratorListStack..ctor(SyntaxNode startingNode, Func
2 descendIntoChildren) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\Core\Portable\Syntax\SyntaxNode.Iterators.cs:line 285
at Microsoft.CodeAnalysis.SyntaxNode.<DescendantNodesAndTokensIntoTrivia>d__59.MoveNext() in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\Core\Portable\Syntax\SyntaxNode.Iterators.cs:line 433
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
at Microsoft.CodeAnalysis.VisualBasic.CodeFixes.SimplifyTypeNames.VisualBasicSimplifyTypeNamesDiagnosticAnalyzer.AnalyzeNode(SyntaxNodeAnalysisContext context) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Closed\Features\VisualBasic\Diagnostics\Analyzers\VisualBasicSimplifyTypeNamesDiagnosticAnalyzer.vb:line 44
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver
1.<>c__DisplayClass5.<ExecuteSyntaxNodeAction>b__6() in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerDriver.cs:line 1308
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver.ExecuteAndCatchIfThrows(DiagnosticAnalyzer analyzer, Action1 addDiagnostic, Func3 continueOnAnalyzerException, Action analyze, CancellationToken cancellationToken) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerDriver.cs:line 991
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver1.ExecuteSyntaxNodeAction(Action1 syntaxNodeAction, SyntaxNode node, DiagnosticAnalyzer analyzer, SemanticModel semanticModel, AnalyzerOptions analyzerOptions, Action1 addDiagnostic, Func3 continueOnAnalyzerException, CancellationToken cancellationToken) in F:\Builds\6272\Roslyn\Main-Signed-Release\src\Open\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerDriver.cs:line 1308
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerDriver1.ExecuteSyntaxNodeActions(AnalyzerActions actions, IEnumerable1 nodes, SemanticModel semanticModel, AnalyzerOptions analyzerOptions, Action`1 addDiagnostic,

comments

angocke wrote Dec 24, 2014 at 12:18 AM

Fixed in changeset 7e1a61be2f2a01aab8836f81723f37c1f649a1b1