blob: 2b7a760f61052cf7fce61918788a38e04215fe88 [file] [log] [blame]
library test /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart:21:112: Error: Inferred type argument 'Cloneable<Object?>' doesn't conform to the bound 'Cloneable<T>' of the type variable 'T' on 'Pair'.
// - 'Cloneable' is from 'pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart'.
// - 'Object' is from 'dart:core'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// new /*error:COULD_NOT_INFER,error:COULD_NOT_INFER*/ /*@typeArgs=Cloneable<Object?>, Cloneable<Object?>*/ Pair
// ^
// pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart:10:12: Context: This is the type variable whose bound isn't conformed to.
// class Pair<T extends Cloneable<T>, U extends Cloneable<U>> {
// ^
//
// pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart:21:112: Error: Inferred type argument 'Cloneable<Object?>' doesn't conform to the bound 'Cloneable<U>' of the type variable 'U' on 'Pair'.
// - 'Cloneable' is from 'pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart'.
// - 'Object' is from 'dart:core'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// new /*error:COULD_NOT_INFER,error:COULD_NOT_INFER*/ /*@typeArgs=Cloneable<Object?>, Cloneable<Object?>*/ Pair
// ^
// pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart:10:36: Context: This is the type variable whose bound isn't conformed to.
// class Pair<T extends Cloneable<T>, U extends Cloneable<U>> {
// ^
//
import self as self;
import "dart:core" as core;
class Cloneable<T extends core::Object? = dynamic> extends core::Object {
synthetic constructor •() self::Cloneable<self::Cloneable::T%>
: super core::Object::•()
;
}
class Pair<T extends self::Cloneable<self::Pair::T> = self::Cloneable<dynamic>, U extends self::Cloneable<self::Pair::U> = self::Cloneable<dynamic>> extends core::Object {
covariant-by-class field self::Pair::T? t;
covariant-by-class field self::Pair::U? u;
constructor •(self::Pair::T? t, self::Pair::U? u) self::Pair<self::Pair::T, self::Pair::U>
: self::Pair::t = t, self::Pair::u = u, super core::Object::•()
;
constructor _() self::Pair<self::Pair::T, self::Pair::U>
: self::Pair::u = null, self::Pair::t = null, super core::Object::•()
;
get reversed() self::Pair<self::Pair::U, self::Pair::T>
return new self::Pair::•<self::Pair::U, self::Pair::T>(this.{self::Pair::u}{self::Pair::U?}, this.{self::Pair::t}{self::Pair::T?});
}
static method main() dynamic {
final self::Pair<self::Cloneable<core::Object?>, self::Cloneable<core::Object?>> x = new self::Pair::_<self::Cloneable<core::Object?>, self::Cloneable<core::Object?>>();
}