blob: df54981efd1d97855794bc62fafd07f3cc4a54f3 [file] [log] [blame]
library test;
import self as self;
import "dart:core" as core;
typedef F<T extends core::Object> = (T) void;
class B<T extends core::Object> extends core::Object {
synthetic constructor •() void
: super core::Object::•()
;
operator +(generic-covariant-impl generic-covariant-interface self::B<self::B::T> other) self::B<self::B::T>
return null;
}
class C<T extends core::Object> extends core::Object {
synthetic constructor •() void
: super core::Object::•()
;
generic-contravariant get x() self::B<(self::C::T) void>
return null;
set x(self::B<(self::C::T) void> value) void {}
}
static method test(self::C<core::num> c) void {
let final self::C<core::num> #t1 = c in #t1.{self::C::x} = (#t1.{self::C::x} as{TypeError} self::B<(core::num) → void>).{self::B::+}(let final dynamic #t2 = new self::B::•<core::num>() in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:21:49: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B<(dart.core::num) \u8594 void>'.
c. /*@checkReturn=B<(num) -> void>*/ x += new B<num>();
^");
self::B<(core::num) → void> y = let final self::C<core::num> #t3 = c in #t3.{self::C::x} = (#t3.{self::C::x} as{TypeError} self::B<(core::num) → void>).{self::B::+}(let final dynamic #t4 = new self::B::•<core::num>() in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:22:57: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B<(dart.core::num) \u8594 void>'.
var y = c. /*@checkReturn=B<(num) -> void>*/ x += new B<num>();
^");
let final self::C<core::num> #t5 = c in (#t5.{self::C::x} as{TypeError} self::B<(core::num) → void>).{core::Object::==}(null) ?{self::B<core::Object>} #t5.{self::C::x} = let final dynamic #t6 = new self::B::•<core::num>() in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:23:50: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B<(dart.core::num) \u8594 void>'.
c. /*@checkReturn=B<(num) -> void>*/ x ??= new B<num>();
^" : null;
self::B<core::Object> z = let final self::C<core::num> #t7 = c in let final dynamic #t8 = #t7.{self::C::x} as{TypeError} self::B<(core::num) → void> in #t8.{core::Object::==}(null) ?{self::B<core::Object>} #t7.{self::C::x} = let final dynamic #t9 = new self::B::•<core::num>() in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:24:58: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B<(dart.core::num) \u8594 void>'.
var z = c. /*@checkReturn=B<(num) -> void>*/ x ??= new B<num>();
^" : #t8;
}
static method main() → dynamic {}