You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
../../tmp/proj/test.dart:3:57: Error: A value of type 'T Function<T>(T)' can't be returned from a function with return type 'int Function(int)'.
int Function(int) specialize(T Function<T>(T) f) => f.call;
After experimenting a bit, I think that the CFE only allows generic instantiation of .call if .call resolves to a method on an actual class; if it resolves to the implicit .call of a function type, that's not supported.
The language team is currently having a discussion about related topics at dart-lang/language#1604, and it's not yet clear to me what the best fix is. So for now I'm assigning this issue to area-language. We can re-assign it to area-front-end or area-analyzer once we decide what we want the correct behavior to be.
The text was updated successfully, but these errors were encountered:
The following code is accepted by the analyzer but rejected by the CFE:
The CFE says:
After experimenting a bit, I think that the CFE only allows generic instantiation of
.call
if.call
resolves to a method on an actual class; if it resolves to the implicit.call
of a function type, that's not supported.The language team is currently having a discussion about related topics at dart-lang/language#1604, and it's not yet clear to me what the best fix is. So for now I'm assigning this issue to
area-language
. We can re-assign it toarea-front-end
orarea-analyzer
once we decide what we want the correct behavior to be.The text was updated successfully, but these errors were encountered: