blob: 86f5a15e1a73539fd2d805fe01dfaeffbe108592 [file] [log] [blame]
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:15:40: Error: Inferred type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'A<X> Function<X extends num>(X)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/instantiation.dart'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// A<dynamic> Function(String) test5() => A.foo; // Error.
// ^
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:5:9: Context: This is the type variable whose bound isn't conformed to.
// class A<X extends num> {
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:16:40: Error: Inferred type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'A<X> Function<X extends num>(X)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/instantiation.dart'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// A<dynamic> Function(String) test6() => A.new; // Error.
// ^
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:5:9: Context: This is the type variable whose bound isn't conformed to.
// class A<X extends num> {
// ^
//
import self as self;
import "dart:core" as core;
class A<X extends core::num> extends core::Object {
constructor foo(self::A::X x) self::A<self::A::X>
: super core::Object::•() {}
constructor •(self::A::X x) self::A<self::A::X>
: super core::Object::•() {}
}
static method test1() (core::num) self::A<core::num>
return self::A::foo<core::num>;
static method test2() (core::int) self::A<core::int>
return self::A::foo<core::int>;
static method test3() (core::num) self::A<core::num>
return self::A::•<core::num>;
static method test4() (core::int) self::A<core::int>
return self::A::•<core::int>;
static method test5() (core::String) self::A<dynamic>
return self::A::foo<core::String>;
static method test6() (core::String) self::A<dynamic>
return self::A::•<core::String>;
static method test7() (core::num) self::A<dynamic>
return self::A::foo<core::num>;
static method test8() (core::num) self::A<dynamic>
return self::A::•<core::num>;
static method main() dynamic {}