dart2js doesn't match void and dynamic return types when checking function types. #13407
Labels
closed-obsolete
Closed as the reported issue is no longer relevant
P3
A lower priority bug or feature request
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
web-dart2js
dart2js doesn't match void and dynamic return types when checking function types. At least not, when
dynamic
is a generic type variable.This is only happening in checked mode.
Example:
$ cat /tmp/bug.dart
class A<T> {
foo(T bar()) => bar();
}
main() {
void bar() {};
new A().foo(bar);
}
$ sdk/bin/dart2js --out=t/foo.js /tmp/bug.dart --checked
$ v8 t/foo.js
t/foo.js:587: type 'main_bar' is not a subtype of type 'T_'
throw H.wrapException(H.TypeErrorImplementation$(object, signatureName));
^
type 'main_bar' is not a subtype of type 'T_'
at wrapException (t/foo.js:332:13)
at assertFunctionSubtype (t/foo.js:587:13)
at main (t/foo.js:874:5)
at t/foo.js:1226:7
at init.currentScript (t/foo.js:1202:5)
at t/foo.js:1220:3
at t/foo.js:1428:3
The text was updated successfully, but these errors were encountered: