| 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 #C3; |
| static method test4() → () → self::A |
| return #C3; |
| static method test5() → () → self::A |
| return #C1; |
| static method test6() → () → self::A |
| return #C1; |
| static method test7() → () → self::B<core::String> |
| return #C5; |
| static method test8() → () → self::B<core::String> |
| return #C5; |
| static method test9() → () → self::B<core::num> |
| return let final Never #t1 = 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 (#C5) as{TypeError,ForNonNullableByDefault} () → self::B<core::num>; |
| static method test10() → () → self::B<core::String> |
| return #C7; |
| static method test11() → () → self::B<core::String> |
| return #C9; |
| static method test12() → () → self::B<core::num> |
| return #C10; |
| static method test13() → () → self::B<core::num> |
| return #C11; |
| static method test14() → () → self::B<core::num> |
| return #C12; |
| static method test15() → () → self::B<core::num> |
| return #C14; |
| static method test16() → <Y extends core::num = dynamic>() → self::B<Y> |
| return #C13; |
| static method test17() → <Y extends core::Object? = dynamic>() → self::B<Y%> |
| return let final Never #t2 = 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 let final Never #t3 = 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 (#C13) as{TypeError,ForNonNullableByDefault} <Y extends core::Object? = dynamic>() → self::B<Y%>; |
| static method test18() → () → self::B<core::num> |
| return #C10; |
| static method test19() → () → self::B<core::num> |
| return #C11; |
| static method test20() → () → self::B<core::num> |
| return #C12; |
| static method test21() → () → self::B<core::num> |
| return #C16; |
| static method test22() → <Y extends core::num = dynamic, Z extends core::String = dynamic>() → self::B<Y> |
| return #C15; |
| static method test23() → <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%> |
| return let final Never #t4 = 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 let final Never #t5 = 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 (#C15) as{TypeError,ForNonNullableByDefault} <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%>; |
| static method test24() → () → self::B<core::String> |
| return #C17; |
| static method main() → dynamic {} |
| |
| constants { |
| #C1 = constructor-tearoff self::A::• |
| #C2 = typedef-tearoff <unrelated X extends core::num>.(#C1) |
| #C3 = instantiation #C2 <core::num*> |
| #C4 = constructor-tearoff self::B::• |
| #C5 = instantiation self::B::• <core::String*> |
| #C6 = constructor-tearoff self::B::foo |
| #C7 = instantiation self::B::foo <core::String*> |
| #C8 = static-tearoff self::B::bar |
| #C9 = instantiation self::B::bar <core::String*> |
| #C10 = instantiation self::B::• <core::num*> |
| #C11 = instantiation self::B::foo <core::num*> |
| #C12 = instantiation self::B::bar <core::num*> |
| #C13 = typedef-tearoff <X extends core::num>.(#C4<X>) |
| #C14 = instantiation #C13 <core::num*> |
| #C15 = typedef-tearoff <X extends core::num, unrelated Y extends core::String>.(#C4<X>) |
| #C16 = instantiation #C15 <core::num*, core::String*> |
| #C17 = instantiation #C13 <Never*> |
| } |