blob: b551a0a7ec4039390fa6196f23bed84ee0dcef4f [file] [log] [blame]
library;
//
// Problems in library:
//
// pkg/front_end/testcases/extensions/check_bounds.dart:23:10: Error: The method 'method' isn't defined for the class 'Class<A>'.
// - 'Class' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// - 'A' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// Try correcting the name to the name of an existing method, or defining a method named 'method'.
// classA.method();
// ^^^^^^
//
// pkg/front_end/testcases/extensions/check_bounds.dart:24:3: Error: Inferred type argument 'A' doesn't conform to the bound 'B' of the type variable 'T' on 'Extension|method'.
// - 'A' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// - 'B' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// Extension(classA).method();
// ^
// pkg/front_end/testcases/extensions/check_bounds.dart:10:21: Context: This is the type variable whose bound isn't conformed to.
// extension Extension<T extends B> on Class<T> {
// ^
//
// pkg/front_end/testcases/extensions/check_bounds.dart:25:3: Error: Inferred type argument 'A' doesn't conform to the bound 'B' of the type variable 'T' on 'Extension|method'.
// - 'A' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// - 'B' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// Extension<A>(classA).method();
// ^
// pkg/front_end/testcases/extensions/check_bounds.dart:10:21: Context: This is the type variable whose bound isn't conformed to.
// extension Extension<T extends B> on Class<T> {
// ^
//
// pkg/front_end/testcases/extensions/check_bounds.dart:31:3: Error: Inferred type argument 'A' doesn't conform to the bound 'B' of the type variable 'T' on 'Extension|method'.
// - 'A' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// - 'B' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// Extension<A>(classB).method();
// ^
// pkg/front_end/testcases/extensions/check_bounds.dart:10:21: Context: This is the type variable whose bound isn't conformed to.
// extension Extension<T extends B> on Class<T> {
// ^
//
// pkg/front_end/testcases/extensions/check_bounds.dart:34:10: Error: Type argument 'A' doesn't conform to the bound 'B' of the type variable 'S' on 'Extension|genericMethod'.
// - 'A' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// - 'B' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// Try changing type arguments so that they conform to the bounds.
// classB.genericMethod(a);
// ^
// pkg/front_end/testcases/extensions/check_bounds.dart:12:17: Context: This is the type variable whose bound isn't conformed to.
// genericMethod<S extends B>(S s) {}
// ^
//
// pkg/front_end/testcases/extensions/check_bounds.dart:35:10: Error: Type argument 'A' doesn't conform to the bound 'B' of the type variable 'S' on 'Extension|genericMethod'.
// - 'A' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// - 'B' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// Try changing type arguments so that they conform to the bounds.
// classB.genericMethod<A>(a);
// ^
// pkg/front_end/testcases/extensions/check_bounds.dart:12:17: Context: This is the type variable whose bound isn't conformed to.
// genericMethod<S extends B>(S s) {}
// ^
//
// pkg/front_end/testcases/extensions/check_bounds.dart:37:3: Error: Inferred type argument 'A' doesn't conform to the bound 'B' of the type variable 'S' on 'Extension|genericMethod'.
// - 'A' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// - 'B' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// Extension(classB).genericMethod(a);
// ^
// pkg/front_end/testcases/extensions/check_bounds.dart:12:17: Context: This is the type variable whose bound isn't conformed to.
// genericMethod<S extends B>(S s) {}
// ^
//
// pkg/front_end/testcases/extensions/check_bounds.dart:40:3: Error: Inferred type argument 'A' doesn't conform to the bound 'B' of the type variable 'T' on 'Extension|genericMethod'.
// - 'A' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// - 'B' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// Extension<A>(classB).genericMethod(a);
// ^
// pkg/front_end/testcases/extensions/check_bounds.dart:10:21: Context: This is the type variable whose bound isn't conformed to.
// extension Extension<T extends B> on Class<T> {
// ^
//
// pkg/front_end/testcases/extensions/check_bounds.dart:40:3: Error: Inferred type argument 'A' doesn't conform to the bound 'B' of the type variable 'S' on 'Extension|genericMethod'.
// - 'A' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// - 'B' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// Extension<A>(classB).genericMethod(a);
// ^
// pkg/front_end/testcases/extensions/check_bounds.dart:12:17: Context: This is the type variable whose bound isn't conformed to.
// genericMethod<S extends B>(S s) {}
// ^
//
// pkg/front_end/testcases/extensions/check_bounds.dart:43:3: Error: Inferred type argument 'A' doesn't conform to the bound 'B' of the type variable 'S' on 'Extension|genericMethod'.
// - 'A' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// - 'B' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// Extension<B>(classB).genericMethod(a);
// ^
// pkg/front_end/testcases/extensions/check_bounds.dart:12:17: Context: This is the type variable whose bound isn't conformed to.
// genericMethod<S extends B>(S s) {}
// ^
//
import self as self;
import "dart:core" as core;
class A extends core::Object {
synthetic constructor •() self::A*
: super core::Object::•()
;
}
class B extends self::A {
synthetic constructor •() self::B*
: super self::A::•()
;
}
class Class<T extends self::A* = self::A*> extends core::Object {
synthetic constructor •() self::Class<self::Class::T*>*
: super core::Object::•()
;
}
extension Extension<T extends self::B* = dynamic> on self::Class<T*>* {
method method = self::Extension|method;
tearoff method = self::Extension|get#method;
method genericMethod = self::Extension|genericMethod;
tearoff genericMethod = self::Extension|get#genericMethod;
}
static method Extension|method<T extends self::B* = dynamic>(final self::Class<self::Extension|method::T*>* #this) → dynamic {}
static method Extension|get#method<T extends self::B* = dynamic>(final self::Class<self::Extension|get#method::T*>* #this) → () →* dynamic
return () dynamic => self::Extension|method<self::Extension|get#method::T*>(#this);
static method Extension|genericMethod<T extends self::B* = dynamic, S extends self::B* = dynamic>(final self::Class<self::Extension|genericMethod::T*>* #this, self::Extension|genericMethod::S* s) → dynamic {}
static method Extension|get#genericMethod<T extends self::B* = dynamic>(final self::Class<self::Extension|get#genericMethod::T*>* #this) → <S extends self::B* = dynamic>(S*) →* dynamic
return <S extends self::B* = dynamic>(S* s) dynamic => self::Extension|genericMethod<self::Extension|get#genericMethod::T*, S*>(#this, s);
static method main() dynamic {}
static method test() dynamic {
self::A* a;
self::Class<self::A*>* classA = new self::Class::•<self::A*>();
invalid-expression "pkg/front_end/testcases/extensions/check_bounds.dart:23:10: Error: The method 'method' isn't defined for the class 'Class<A>'.
- 'Class' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
- 'A' is from 'pkg/front_end/testcases/extensions/check_bounds.dart'.
Try correcting the name to the name of an existing method, or defining a method named 'method'.
classA.method();
^^^^^^";
self::Extension|method<self::A*>(classA);
self::Extension|method<self::A*>(classA);
self::Extension|method<self::B*>(classA as{TypeError} self::Class<self::B*>*);
self::Class<self::B*>* classB = new self::Class::•<self::B*>();
self::Extension|method<self::B*>(classB);
self::Extension|method<self::B*>(classB);
self::Extension|method<self::A*>(classB);
self::Extension|method<self::B*>(classB);
self::Extension|genericMethod<self::B*, self::A*>(classB, a);
self::Extension|genericMethod<self::B*, self::A*>(classB, a);
self::Extension|genericMethod<self::B*, self::B*>(classB, a as{TypeError} self::B*);
self::Extension|genericMethod<self::B*, self::A*>(classB, a);
self::Extension|genericMethod<self::B*, self::A*>(classB, a);
self::Extension|genericMethod<self::B*, self::B*>(classB, a as{TypeError} self::B*);
self::Extension|genericMethod<self::A*, self::A*>(classB, a);
self::Extension|genericMethod<self::A*, self::A*>(classB, a);
self::Extension|genericMethod<self::A*, self::B*>(classB, a as{TypeError} self::B*);
self::Extension|genericMethod<self::B*, self::A*>(classB, a);
self::Extension|genericMethod<self::B*, self::A*>(classB, a);
self::Extension|genericMethod<self::B*, self::B*>(classB, a as{TypeError} self::B*);
}