-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
legacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Milestone
Description
Given this code:
class Test {
T get<T>() {
return null;
}
T call<T>() {
return get<T>();
}
}
main() {
var test = new Test();
var a = test.get<String>();
var b = test<String>();
var c = test.call<String>();
}
a
and c
are typed as String
, but b
is typed as T
(even though no such class exists, and there are no warnings in this code). If I remove the T
as the return type from the call
method, then the type becomes dynamic
.
I presume this should work, but I couldn't find any info on it. I found a couple of open issues about callable classes, but I don't think any are describing this.
Tested with the latest analyzer that's in Flutter master.
escamoteur
Metadata
Metadata
Assignees
Labels
legacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)