-
Notifications
You must be signed in to change notification settings - Fork 119
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
Allow embedded type parameters in references #2772
Allow embedded type parameters in references #2772
Conversation
@@ -203,6 +203,31 @@ void main() { | |||
expect(referenceLookup(constructorTearoffs, 'Ft.new'), | |||
equals(MatchingLinkResult(Fnew))); | |||
}); | |||
|
|||
test('we can use (ignored) type parameters in references', () { | |||
expect(referenceLookup(E, 'D<String>.new'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A type argument can also be a prefixed identifier, like <core.String>
.
By all means, does not have to be addressed in this CL, but maybe a TODO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Didn't add a test for that, but should be supported by the code here as well.
Everything in this PR refers to "type parameters" but is really concerned with "type arguments", at least as far as the analyzer API and language spec are concerned. In that verbiage:
If "type parameters" are the term used throughout dartdoc though, than I think its fine to keep using in this PR for consistency. WDYT? |
@srawlins Part of the problem here is we allow people to pretend they are using arguments or type parameters interchangeably in dartdoc comment references and unfortunately that has spilled out not only into the rest of the code but into my brain when I talk about them. I really should go back and fix all of that, I'll give that a try for this PR. |
renamed some things here. PTAL |
Continues work for #2655.
Given that type parameters have more interesting uses with tearoffs now, add the capacity to embed (and ignore) type parameters inside comment references. They are ignored because a single reference can still only point to a single page.