| library test; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:20:49: 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'. |
| // Try changing the type of the left hand side, or casting the right hand side to 'B<void Function(num)>'. |
| // c. /*@checkReturn=B<(num) -> void>*/ x += new B<num>(); |
| // ^ |
| // |
| // pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:21:57: 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'. |
| // Try changing the type of the left hand side, or casting the right hand side to 'B<void Function(num)>'. |
| // 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:50: 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'. |
| // Try changing the type of the left hand side, or casting the right hand side to 'B<void Function(num)>'. |
| // c. /*@checkReturn=B<(num) -> void>*/ x ??= new B<num>(); |
| // ^ |
| // |
| // pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:23:58: 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'. |
| // Try changing the type of the left hand side, or casting the right hand side to 'B<void Function(num)>'. |
| // var z = c. /*@checkReturn=B<(num) -> void>*/ x ??= new B<num>(); |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| typedef F<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:49: 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'. |
| Try changing the type of the left hand side, or casting the right hand side to 'B<void Function(num)>'. |
| 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:57: 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'. |
| Try changing the type of the left hand side, or casting the right hand side to 'B<void Function(num)>'. |
| 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:50: 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'. |
| Try changing the type of the left hand side, or casting the right hand side to 'B<void Function(num)>'. |
| 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 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<BottomType> #t9 = invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:23:58: 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'. |
| Try changing the type of the left hand side, or casting the right hand side to 'B<void Function(num)>'. |
| 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 {} |