blob: e445535ffacbd2b6918df70d9902e0d092195e0f [file] [log] [blame]
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:28:25: Error: Type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'DA2'.
// Try changing type arguments so that they conform to the bounds.
// A Function() test5() => DA2<String>.new; // Error.
// ^
// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:15:13: Context: This is the type variable whose bound isn't conformed to.
// typedef DA2<X extends num> = A;
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:33:30: Error: A value of type 'B<String> Function()' can't be returned from a function with return type 'B<num> Function()'.
// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
// B<num> Function() test9() => DB1.new; // Error.
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<X> Function<X extends num>()' can't be assigned to a variable of type 'B<Y> Function<Y>()'.
// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
// B<Y> Function<Y>() test17() => DB2.new; // Error.
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<X> Function<X extends num>()' can't be returned from a function with return type 'B<Y> Function<Y>()'.
// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
// B<Y> Function<Y>() test17() => DB2.new; // Error.
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<X> Function<X extends num, Y extends String>()' can't be assigned to a variable of type 'B<Y> Function<Y, Z>()'.
// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
// B<Y> Function<Y, Z>() test23() => DB3.new; // Error.
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<X> Function<X extends num, Y extends String>()' can't be returned from a function with return type 'B<Y> Function<Y, Z>()'.
// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
// B<Y> Function<Y, Z>() test23() => DB3.new; // Error.
// ^
//
import self as self;
import "dart:core" as core;
typedef DA1 = self::A;
typedef DA2<unrelated X extends core::num> = self::A;
typedef DB1 = self::B<core::String>;
typedef DB2<X extends core::num> = self::B<X>;
typedef DB3<X extends core::num, unrelated Y extends core::String> = self::B<X>;
class A extends core::Object {
synthetic constructor •() self::A
: super core::Object::•()
;
}
class B<X extends core::Object? = dynamic> extends core::Object {
constructor •() self::B<self::B::X%>
: super core::Object::•()
;
constructor foo() self::B<self::B::X%>
: super core::Object::•()
;
static factory bar<X extends core::Object? = dynamic>() self::B<self::B::bar::X%>
return new self::B::•<self::B::bar::X%>();
}
static method test1() () self::A
return #C1;
static method test2() () self::A
return #C1;
static method test3() () self::A
return #C2;
static method test4() () self::A
return #C2;
static method test5() () self::A
return #C1;
static method test6() () self::A
return #C1;
static method test7() () self::B<core::String>
return #C4;
static method test8() () self::B<core::String>
return #C4;
static method test9() () self::B<core::num>
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:33:30: Error: A value of type 'B<String> Function()' can't be returned from a function with return type 'B<num> Function()'.
- 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
B<num> Function() test9() => DB1.new; // Error.
^" in (#C4) as{TypeError,ForNonNullableByDefault} () self::B<core::num>;
static method test10() () self::B<core::String>
return #C6;
static method test11() () self::B<core::String>
return #C8;
static method test12() () self::B<core::num>
return #C9;
static method test13() () self::B<core::num>
return #C10;
static method test14() () self::B<core::num>
return #C11;
static method test15() () self::B<core::num>
return #C9;
static method test16() <Y extends core::num = dynamic>() self::B<Y>
return #C12;
static method test17() <Y extends core::Object? = dynamic>() self::B<Y%>
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<X> Function<X extends num>()' can't be returned from a function with return type 'B<Y> Function<Y>()'.
- 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
B<Y> Function<Y>() test17() => DB2.new; // Error.
^" in invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<X> Function<X extends num>()' can't be assigned to a variable of type 'B<Y> Function<Y>()'.
- 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
B<Y> Function<Y>() test17() => DB2.new; // Error.
^" in (#C12) as{TypeError,ForNonNullableByDefault} <Y extends core::Object? = dynamic>() self::B<Y%> as{TypeError,ForNonNullableByDefault} <Y extends core::Object? = dynamic>() self::B<Y%>;
static method test18() () self::B<core::num>
return #C9;
static method test19() () self::B<core::num>
return #C10;
static method test20() () self::B<core::num>
return #C11;
static method test21() () self::B<core::num>
return #C9;
static method test22() <Y extends core::num = dynamic, Z extends core::String = dynamic>() self::B<Y>
return #C13;
static method test23() <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() self::B<Y%>
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<X> Function<X extends num, Y extends String>()' can't be returned from a function with return type 'B<Y> Function<Y, Z>()'.
- 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
B<Y> Function<Y, Z>() test23() => DB3.new; // Error.
^" in invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<X> Function<X extends num, Y extends String>()' can't be assigned to a variable of type 'B<Y> Function<Y, Z>()'.
- 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
B<Y> Function<Y, Z>() test23() => DB3.new; // Error.
^" in (#C13) as{TypeError,ForNonNullableByDefault} <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() self::B<Y%> as{TypeError,ForNonNullableByDefault} <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() self::B<Y%>;
static method test24() () self::B<core::String>
return #C14;
static method main() dynamic {}
constants {
#C1 = constructor-tearoff self::A::•
#C2 = instantiation self::A::• <>
#C3 = constructor-tearoff self::B::•
#C4 = instantiation self::B::• <core::String>
#C5 = constructor-tearoff self::B::foo
#C6 = instantiation self::B::foo <core::String>
#C7 = static-tearoff self::B::bar
#C8 = instantiation self::B::bar <core::String>
#C9 = instantiation self::B::• <core::num>
#C10 = instantiation self::B::foo <core::num>
#C11 = instantiation self::B::bar <core::num>
#C12 = typedef-tearoff <X extends core::num>.(#C3<X>)
#C13 = typedef-tearoff <X extends core::num, unrelated Y extends core::String>.(#C3<X>)
#C14 = instantiation self::B::• <Never>
}