blob: d3b1e07d7018fcdb5b16df9faad0a2ea8bc38f15 [file] [log] [blame]
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:20:54: Error: The argument type 'B<num>' can't be assigned to the parameter type 'B<void Function(num)>'.
// - 'B' is from 'pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart'.
// c. /*@ checkReturn=B<(num*) ->* void>* */ x += new B<num>();
// ^
//
// pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:21:62: Error: The argument type 'B<num>' can't be assigned to the parameter type 'B<void Function(num)>'.
// - 'B' is from 'pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart'.
// var y = c. /*@ checkReturn=B<(num*) ->* void>* */ x += new B<num>();
// ^
//
// pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:22:55: Error: A value of type 'B<num>' can't be assigned to a variable of type 'B<void Function(num)>'.
// - 'B' is from 'pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart'.
// c. /*@ checkReturn=B<(num*) ->* void>* */ x ??= new B<num>();
// ^
//
// pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:23:63: Error: A value of type 'B<num>' can't be assigned to a variable of type 'B<void Function(num)>'.
// - 'B' is from 'pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart'.
// var z = c. /*@ checkReturn=B<(num*) ->* void>* */ x ??= new B<num>();
// ^
//
import self as self;
import "dart:core" as core;
typedef F<contravariant T extends core::Object* = dynamic> = (T*) →* void;
class B<T extends core::Object* = dynamic> extends core::Object {
synthetic constructor •() self::B<self::B::T*>*
: super core::Object::•()
;
operator +(generic-covariant-impl self::B<self::B::T*>* other) self::B<self::B::T*>*
return null;
}
class C<T extends core::Object* = dynamic> extends core::Object {
synthetic constructor •() self::C<self::C::T*>*
: super core::Object::•()
;
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<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:20:54: Error: The argument type 'B<num>' can't be assigned to the parameter type 'B<void Function(num)>'.
- 'B' is from 'pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart'.
c. /*@ checkReturn=B<(num*) ->* void>* */ x += new B<num>();
^" in new self::B::•<core::num*>() as{TypeError} self::B<(core::num*) →* void>*);
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<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:21:62: Error: The argument type 'B<num>' can't be assigned to the parameter type 'B<void Function(num)>'.
- 'B' is from 'pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart'.
var y = c. /*@ checkReturn=B<(num*) ->* void>* */ x += new B<num>();
^" in new self::B::•<core::num*>() as{TypeError} self::B<(core::num*) →* void>*);
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<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:22:55: Error: A value of type 'B<num>' can't be assigned to a variable of type 'B<void Function(num)>'.
- 'B' is from 'pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart'.
c. /*@ checkReturn=B<(num*) ->* void>* */ x ??= new B<num>();
^" in new self::B::•<core::num*>() as{TypeError} self::B<(core::num*) →* void>* : null;
self::B<core::Object*>* z = let final self::C<core::num*>* #t7 = c in let final self::B<(core::num*) →* void>* #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<BottomType> #t9 = invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:23:63: Error: A value of type 'B<num>' can't be assigned to a variable of type 'B<void Function(num)>'.
- 'B' is from 'pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart'.
var z = c. /*@ checkReturn=B<(num*) ->* void>* */ x ??= new B<num>();
^" in new self::B::•<core::num*>() as{TypeError} self::B<(core::num*) →* void>* : #t8;
}
static method main() → dynamic {}