-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work ondart-model-analyzer-specIssues with the analyzer's implementation of the language specIssues with the analyzer's implementation of the language speclegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.
Description
Consider the following program:
X id<X>(X x) => x;
void main() {
int Function(int) f = id; // No problems, instantiates `id` as `id<int>`.
var idVar = id; // Tears off `id`, yielding a generic function object.
int Function(int) g = idVar; // Error.
}
The initialization of g
is a compile-time error, because idVar
is a variable and not a function declaration. However, the analyzer (as of commit ffde158) does not report any errors for this program.
With --enable-experiment=constructor-tearoff
we should get an error at the explicit instantiation idVar<int>
as well, and that error is also missing. Note that this question was discussed here.
Note that this should not be a breaking change, because the CFE already reports this error.
srawlins
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work ondart-model-analyzer-specIssues with the analyzer's implementation of the language specIssues with the analyzer's implementation of the language speclegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.