Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when binding generic method inside cref when parens and parameters are included in the signature #2189

Open
shyamnamboodiripad opened this issue Apr 22, 2015 · 2 comments
Assignees
Labels
Area-Compilers Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Milestone

Comments

@shyamnamboodiripad
Copy link
Contributor

I am not sure what the correct behavior is for the below. But the current behavior certainly seems inconsistent.

capture

@shyamnamboodiripad
Copy link
Contributor Author

I haven't checked but it would also be interesting to see what behavior the VS 2013 VB compiler has for the above repro.

@AlekseyTs
Copy link
Contributor

Given the following code:

''' <summary>
''' <see cref="C.N"/>
''' <see cref="C.N()"/>
''' 
''' <see cref="C.M(Of U)"/>
''' <see cref="C.M(Of U)()"/>
''' 
''' <see cref="C.M2(Of U)"/>
''' <see cref="C.M2(Of U)()"/>
''' <see cref="C.M2(Of U)(U)"/>
''' 
''' <see cref="C.M(Of Integer)"/>
''' <see cref="C.M(Of Integer)()"/>
''' 
''' <see cref="C.M2(Of Integer)"/>
''' <see cref="C.M2(Of Integer)()"/>
''' <see cref="C.M2(Of Integer)(Integer)"/>
''' 
''' <see cref="C.M(Of OtherClass)"/>
''' <see cref="C.M(Of OtherClass)()"/>
''' 
''' <see cref="C.M2(Of OtherClass)"/>
''' <see cref="C.M2(Of OtherClass)()"/>
''' <see cref="C.M2(Of OtherClass)(OtherClass)"/>
''' 
''' <see cref="C.M(Of [Integer])"/>
''' <see cref="C.M(Of [Integer])()"/>
''' 
''' <see cref="C.M2(Of [Integer])"/>
''' <see cref="C.M2(Of [Integer])()"/>
''' <see cref="C.M2(Of [Integer])([Integer])"/>
''' </summary>
Class C
    Sub M(Of T As Structure)()
    End Sub

    Sub M2(Of T As Structure)(x As T)
    End Sub

    Sub N()
    End Sub
End Class

Class OtherClass
End Class

VS2013 reports:

warning BC42309: XML comment has a tag with a 'cref' attribute 'C.N()' that could not be resolved. XML comment will be ignored.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M(Of U)()' that could not be resolved. XML comment will be ignored.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M2(Of U)()' that could not be resolved. XML comment will be ignored.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M2(Of U)(U)' that could not be resolved. XML comment will be ignored.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M(Of Integer)()' that could not be resolved. XML comment will be ignored.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M2(Of Integer)()' that could not be resolved. XML comment will be ignored.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M2(Of Integer)(Integer)' that could not be resolved. XML comment will be ignored.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M(Of OtherClass)()' that could not be resolved. XML comment will be ignored.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M2(Of OtherClass)()' that could not be resolved. XML comment will be ignored.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M2(Of OtherClass)(OtherClass)' that could not be resolved. XML comment will be ignored.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M(Of [Integer])()' that could not be resolved. XML comment will be ignored.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M2(Of [Integer])()' that could not be resolved. XML comment will be ignored.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M2(Of [Integer])([Integer])' that could not be resolved. XML comment will be ignored.

VS2015 reports:

warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M2(Of U)()' that could not be resolved.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M(Of Integer)()' that could not be resolved.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M2(Of Integer)()' that could not be resolved.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M2(Of Integer)(Integer)' that could not be resolved.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M2(Of OtherClass)()' that could not be resolved.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M2(Of [Integer])()' that could not be resolved.

VS2013 didn't support method parameter lists at all, so VS2015 behavior looks like an improvement to me. The only warnings reported by VS2015 (they are also reported by VS2013) that might look confusing are:

warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M(Of Integer)()' that could not be resolved.
warning BC42309: XML comment has a tag with a 'cref' attribute 'C.M2(Of Integer)(Integer)' that could not be resolved.

When a parameter list is specified, the names in the (Of …) part are actually treated as new type parameters rather than as type arguments. That is, they declare new types, which can be referred to in the parameter list. They do not refer to any existing type, for example Global.OtherClass cannot be used there. I suspect the Integer cannot be used there either because it is a keyword. We should consider improving diagnostics to make it clearer that the list of generic type parameters is likely the source of the problem.

@jaredpar jaredpar modified the milestones: 1.2, 1.1, 2.0 Sep 16, 2015
@gafter gafter modified the milestones: 2.0 (Preview 1), 2.0 (RC) Jun 20, 2016
@jaredpar jaredpar modified the milestones: 2.0 (RC), 2.1 Jul 19, 2016
@jaredpar jaredpar added the help wanted The issue is "up for grabs" - add a comment if you are interested in working on it label Feb 7, 2017
@jaredpar jaredpar modified the milestones: Unknown, 2.1 Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Projects
None yet
Development

No branches or pull requests

4 participants