Consider the following script:
void foo<T extends num>(T t) {}
class Foo<U extends num> {}
main() {
foo("bar");
new Foo<String>();
}
Both lines in main should result in a compile-time error, because String is not a subtype of num. However, currently it is compiled into the following without any error messages:
library;
import self as self;
import "dart:core" as core;
class Foo<U extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
static method foo<T extends core::num = core::num>(self::foo::T t) → void {}
static method main() → dynamic {
self::foo<core::String>("bar");
new self::Foo::•<core::String>();
}
Consider the following script:
Both lines in
mainshould result in a compile-time error, becauseStringis not a subtype ofnum. However, currently it is compiled into the following without any error messages: