| library /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/nnbd/extension_type_variable_bound.dart:19:15: Error: A value of type 'T' can't be returned from a function with return type 'Class'. |
| // - 'Class' is from 'pkg/front_end/testcases/nnbd/extension_type_variable_bound.dart'. |
| // return t1.method1(); |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/extension_type_variable_bound.dart:26:28: Error: A value of type 'T' can't be assigned to a variable of type 'SubClass'. |
| // - 'SubClass' is from 'pkg/front_end/testcases/nnbd/extension_type_variable_bound.dart'. |
| // SubClass subClass = t2.method2(); |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/extension_type_variable_bound.dart:32:28: Error: The method 'method2' isn't defined for the class 'SubClass'. |
| // - 'SubClass' is from 'pkg/front_end/testcases/nnbd/extension_type_variable_bound.dart'. |
| // Try correcting the name to the name of an existing method, or defining a method named 'method2'. |
| // SubClass subClass = t3.method2(); |
| // ^^^^^^^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| class Class extends core::Object { |
| synthetic constructor •() → self::Class |
| : super core::Object::•() |
| ; |
| } |
| class SubClass extends self::Class { |
| synthetic constructor •() → self::SubClass |
| : super self::Class::•() |
| ; |
| } |
| extension Extension<T extends core::Object? = dynamic> on T% { |
| method method1 = self::Extension|method1; |
| tearoff method1 = self::Extension|get#method1; |
| } |
| extension BoundExtension<T extends self::Class> on T { |
| method method2 = self::BoundExtension|method2; |
| tearoff method2 = self::BoundExtension|get#method2; |
| } |
| static method Extension|method1<T extends core::Object? = dynamic>(lowered final self::Extension|method1::T% #this) → self::Extension|method1::T% |
| return #this; |
| static method Extension|get#method1<T extends core::Object? = dynamic>(lowered final self::Extension|get#method1::T% #this) → () → self::Extension|get#method1::T% |
| return () → self::Extension|get#method1::T% => self::Extension|method1<self::Extension|get#method1::T%>(#this); |
| static method BoundExtension|method2<T extends self::Class>(lowered final self::BoundExtension|method2::T #this) → self::BoundExtension|method2::T |
| return #this; |
| static method BoundExtension|get#method2<T extends self::Class>(lowered final self::BoundExtension|get#method2::T #this) → () → self::BoundExtension|get#method2::T |
| return () → self::BoundExtension|get#method2::T => self::BoundExtension|method2<self::BoundExtension|get#method2::T>(#this); |
| static method test1<T extends core::Object? = dynamic>(self::test1::T% t1) → self::Class { |
| if(t1 is{ForNonNullableByDefault} self::SubClass) { |
| return let final Never #t1 = invalid-expression "pkg/front_end/testcases/nnbd/extension_type_variable_bound.dart:19:15: Error: A value of type 'T' can't be returned from a function with return type 'Class'. |
| - 'Class' is from 'pkg/front_end/testcases/nnbd/extension_type_variable_bound.dart'. |
| return t1.method1(); |
| ^" in self::Extension|method1<self::test1::T%>(t1{self::test1::T% & self::SubClass /* '%' & '!' = '!' */}) as{TypeError,ForNonNullableByDefault} self::Class; |
| } |
| return new self::Class::•(); |
| } |
| static method test2<T extends self::Class>(self::test2::T t2) → dynamic { |
| if(self::test2::T =={core::Type::==}{(core::Object) → core::bool} (#C1)) { |
| self::SubClass subClass = let final Never #t2 = invalid-expression "pkg/front_end/testcases/nnbd/extension_type_variable_bound.dart:26:28: Error: A value of type 'T' can't be assigned to a variable of type 'SubClass'. |
| - 'SubClass' is from 'pkg/front_end/testcases/nnbd/extension_type_variable_bound.dart'. |
| SubClass subClass = t2.method2(); |
| ^" in self::BoundExtension|method2<self::test2::T>(t2) as{TypeError,ForNonNullableByDefault} self::SubClass; |
| } |
| } |
| static method test3<T extends core::Object? = dynamic>(self::test3::T% t3) → dynamic { |
| if(t3 is{ForNonNullableByDefault} self::SubClass) { |
| self::SubClass subClass = invalid-expression "pkg/front_end/testcases/nnbd/extension_type_variable_bound.dart:32:28: Error: The method 'method2' isn't defined for the class 'SubClass'. |
| - 'SubClass' is from 'pkg/front_end/testcases/nnbd/extension_type_variable_bound.dart'. |
| Try correcting the name to the name of an existing method, or defining a method named 'method2'. |
| SubClass subClass = t3.method2(); |
| ^^^^^^^" as{TypeError,ForDynamic,ForNonNullableByDefault} self::SubClass; |
| } |
| } |
| static method main() → dynamic {} |
| |
| constants { |
| #C1 = TypeLiteralConstant(self::SubClass) |
| } |