| library test; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:22: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'. |
| // c. /*@checkReturn=B<(num) -> void>*/ x += new B<num>(); |
| // ^ |
| // |
| // pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:23: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'. |
| // var y = c. /*@checkReturn=B<(num) -> void>*/ x += new B<num>(); |
| // ^ |
| // |
| // pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:24:52: 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>?*/ x2 ??= new B<num>(); |
| // ^ |
| // |
| // pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:25:60: 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>?*/ x2 ??= 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 +(covariant-by-class self::B<self::B::T%> other) → self::B<self::B::T%> |
| return throw ""; |
| } |
| 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 throw ""; |
| set x(self::B<(self::C::T%) → void> value) → void {} |
| get x2() → self::B<(self::C::T%) → void>? |
| return null; |
| set x2(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}{self::B<(core::num) → void>} as{TypeError,CovarianceCheck} self::B<(core::num) → void>).{self::B::+}(invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:22: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'. |
| 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>) → self::B<(core::num) → void>}; |
| self::B<(core::num) → void> y = let final self::C<core::num> #t2 = c in #t2.{self::C::x} = (#t2.{self::C::x}{self::B<(core::num) → void>} as{TypeError,CovarianceCheck} self::B<(core::num) → void>).{self::B::+}(invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:23: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'. |
| var y = 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>) → self::B<(core::num) → void>}; |
| let final self::C<core::num> #t3 = c in #t3.{self::C::x2}{self::B<(core::num) → void>?} as{TypeError,CovarianceCheck} self::B<(core::num) → void>? == null ?{self::B<core::Object>?} #t3.{self::C::x2} = invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:24:52: 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>?*/ x2 ??= 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> #t4 = c in let final self::B<(core::num) → void>? #t5 = #t4.{self::C::x2}{self::B<(core::num) → void>?} as{TypeError,CovarianceCheck} self::B<(core::num) → void>? in #t5 == null ?{self::B<core::Object>} #t4.{self::C::x2} = invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:25:60: 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>?*/ x2 ??= new B<num>(); |
| ^" in new self::B::•<core::num>() as{TypeError} self::B<(core::num) → void>? : #t5{self::B<(core::num) → void>}; |
| } |
| static method main() → dynamic {} |