Closed
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.