blob: 0994723432cfff887e13ee05126dd824c47e6bf4 [file] [log] [blame]
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/extensions/extension_setter_error.dart:15:41: Error: A value of type 'GenericClass<int>' can't be assigned to a variable of type 'GenericClass<double>'.
// - 'GenericClass' is from 'pkg/front_end/testcases/extensions/extension_setter_error.dart'.
// expect(null, GenericExtension<double>(genericClass).setter = null);
// ^
//
import self as self;
import "dart:core" as core;
class GenericClass<T extends core::Object? = dynamic> extends core::Object {
synthetic constructor •() self::GenericClass<self::GenericClass::T%>
: super core::Object::•()
;
}
extension GenericExtension<T extends core::Object? = dynamic> on self::GenericClass<T%> {
set setter = self::GenericExtension|set#setter;
}
static method GenericExtension|set#setter<T extends core::Object? = dynamic>(lowered final self::GenericClass<self::GenericExtension|set#setter::T%> #this, self::GenericExtension|set#setter::T? value) → void {}
static method main() dynamic {}
static method error() dynamic {
self::GenericClass<core::int> genericClass = new self::GenericClass::•<core::int>();
self::expect(null, let final self::GenericClass<core::int> #t1 = invalid-expression "pkg/front_end/testcases/extensions/extension_setter_error.dart:15:41: Error: A value of type 'GenericClass<int>' can't be assigned to a variable of type 'GenericClass<double>'.
- 'GenericClass' is from 'pkg/front_end/testcases/extensions/extension_setter_error.dart'.
expect(null, GenericExtension<double>(genericClass).setter = null);
^" in genericClass as{TypeError,ForNonNullableByDefault} self::GenericClass<core::double> in let final has-declared-initializer Null #t2 = null in let final void #t3 = self::GenericExtension|set#setter<core::double>(#t1, #t2) in #t2);
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) {
throw "Mismatch: expected=${expected}, actual=${actual}";
}
}