Skip to content

Analyzer should warn about uncommented use of commented type parameters #26137

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

Closed
nex3 opened this issue Mar 30, 2016 · 4 comments
Closed

Analyzer should warn about uncommented use of commented type parameters #26137

nex3 opened this issue Mar 30, 2016 · 4 comments
Labels
legacy-area-analyzer Use area-devexp instead. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug

Comments

@nex3
Copy link
Member

nex3 commented Mar 30, 2016

The following code:

foo/*<T>*/() => <T>[];

is clearly invalid; it will fail in any implementation that's not aware of the commented generic syntax, including the Dart VM. The analyzer should warn about it even in strong mode to help users avoid the failures like this.

@nex3 nex3 added legacy-area-analyzer Use area-devexp instead. analyzer-strong-mode type-enhancement A request for a change that isn't a bug labels Mar 30, 2016
@jmesserly
Copy link

Related to these closed bugs: #24985 (comment), #25637 (comment)

Unfortunately we don't have the capability in the architecture to catch things like this. For better or worse a decision was made early on to invest minimally in the generic method comments, to keep it easy to ditch comments when generic method syntax is implemented in the VM. I think that reasoning still holds.

(By design, the scanner is the only one that knows much about the comments -- even the parser only knows a little bit, only enough to find the comments and insert them in the token stream. The benefit is nothing after that knows about comments, so we can easily transition to the real syntax, because from most of the Analyzer's perspective, there is no comments, only the real syntax. Unfortunately, it means the comments aren't first class, and we can't do semantic analysis on them, for example, to issue errors about incorrect usage of the comment form.)

@jmesserly
Copy link

@vsmenon or @floitschG might have an update on the status of real generic method syntax?

@eernstg
Copy link
Member

eernstg commented Mar 31, 2016

I'm working on generic method syntax for dart2js; currently we can parse most of it, but we also need to integrate the type variables with the static analysis (it might work to consider them to denote dynamic, but we haven't explored that yet). So it's coming.

@bwilkerson bwilkerson added the P2 A bug or feature request we're likely to work on label Mar 31, 2016
@jmesserly jmesserly added P3 A lower priority bug or feature request and removed P2 A bug or feature request we're likely to work on labels Aug 9, 2016
@bwilkerson
Copy link
Member

Given that support for the comment syntax is being removed, I'm going to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-analyzer Use area-devexp instead. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants