blob: d5f25e2935b30c450778d3894ff8106ae85b1f40 [file] [log] [blame]
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/extensions/type_variable_bound2.dart:32:28: Error: The method 'method2' isn't defined for the class 'SubClass'.
// - 'SubClass' is from 'pkg/front_end/testcases/extensions/type_variable_bound2.dart'.
// Try correcting the name to the name of an existing method, or defining a method named 'method2'.
// SubClass subClass = t3.method2() as SubClass; // error
// ^^^^^^^
//
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 self::Extension|method1<self::test1::T%>(t1{self::test1::T% & self::SubClass /* '%' & '!' = '!' */}) as{ForNonNullableByDefault} self::SubClass;
}
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 = self::BoundExtension|method2<self::test2::T>(t2) as{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/extensions/type_variable_bound2.dart:32:28: Error: The method 'method2' isn't defined for the class 'SubClass'.
- 'SubClass' is from 'pkg/front_end/testcases/extensions/type_variable_bound2.dart'.
Try correcting the name to the name of an existing method, or defining a method named 'method2'.
SubClass subClass = t3.method2() as SubClass; // error
^^^^^^^" in t3{self::test3::T% & self::SubClass /* '%' & '!' = '!' */}{<unresolved>}.method2() as{ForNonNullableByDefault} self::SubClass;
}
}
static method main() dynamic {}
constants {
#C1 = TypeLiteralConstant(self::SubClass*)
}