dotnet/roslyn

VB SemanticModel fails to bind type argument inside cref even though compiler produces no error

Open

#2.197 aberto em 23 de abr. de 2015

Ver no GitHub
 (0 comments) (0 reactions) (0 assignees)C# (4.257 forks)batch import
Area-CompilersBugConcept-APIhelp wanted

Métricas do repositório

Stars
 (20.414 stars)
Métricas de merge de PR
 (Mesclagem média 6d 17h) (256 fundiu PRs em 30d)

Description

The C# compiler (SemanticModel) correctly returns a TypeParameter symbol for the U in <see cref="C{U}"/> in the below example. I can validate this in the syntax visualizer (see below screenshot) and this also works via API (for example if I get symbol for C{U} and inspect its symbol.TypeArguments. capture

For the corresponding case in VB, U does not bind (see below screenshot). If I get symbol for C(Of U) and inspect its symbol.TypeArguments, I get back a ErrorTypeSymbol. capture2

Shouldn't the VB compiler be able to return a valid symbol in the above case (considering that the code didn't produce any errors)? Why do the two compilers behave differently here.

Guia do colaborador