-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Open
Labels
Area-CompilersBugConcept-APIThis issue involves adding, removing, clarification, or modification of an API.This issue involves adding, removing, clarification, or modification of an API.help wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Milestone
Description
When I type the below code and turn on xml doc comment generation in the project settings, I noticed that ? is actually parsed as a skipped token - which indicates that the syntax was erroneous. Yet the compiler gives me no warning (which means that the cref will not be emitted correctly).
- If I replace
Integer?withNullable(Of Integer), there is no longer any skipped tokens and no errors either. However, I am not sure whether this is legal - in C# we only allow unconstructed generic types in crefs (except when specifying parameter types) - so it is legal to say<see cref="Nullable{T}"/>but it is not legal to say<see cref="Nullable{Integer}"/>. In any case, if I inspect symbols forNullable(Of Integer)andIntegerusing the syntax visualizer, I can see that both identifiers bind correctly (see screenshot below). So I guess this must be legal in VB. - But if this is legal in VB, then shouldn't using the short form syntax
Integer?be legal too? Why does the parser skip the?token? And why doesn't it produce any errors if this is illegal.
- The specific reason I am logging this issue is that this inconsistent behavior makes detection of when we should offer to simplify
Nullable(Of Something)toSomething?within crefs in VB quite difficult. (Looks like VB is inconsistent with C# here + the VB compiler is also inconsistent with itself w.r.t interchangeability of short and long form syntax for nullables.) But this also feels like it would impact any tools / extensions that want to do analysis within crefs.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-CompilersBugConcept-APIThis issue involves adding, removing, clarification, or modification of an API.This issue involves adding, removing, clarification, or modification of an API.help wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
