| library test /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart:22:55: Error: A value of type 'String' can't be assigned to a variable of type 'int?'. |
| // x. /*@target=C.t*/ t = /*error:INVALID_ASSIGNMENT*/ 'hello'; |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| class C<T extends core::Object? = dynamic> extends core::Object { |
| covariant-by-class field self::C::T? t = null; |
| constructor _() → self::C<self::C::T%> |
| : super core::Object::•() |
| ; |
| static factory •<T extends core::Object? = dynamic>(self::C::•::T% t) → self::C<self::C::•::T%> { |
| self::C<self::C::•::T%> x = new self::C::_<self::C::•::T%>(); |
| x.{self::C::t} = t; |
| return x; |
| } |
| } |
| static method test() → dynamic { |
| self::C<core::int> x = self::C::•<core::int>(42); |
| x.{self::C::t} = invalid-expression "pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart:22:55: Error: A value of type 'String' can't be assigned to a variable of type 'int?'. |
| x. /*@target=C.t*/ t = /*error:INVALID_ASSIGNMENT*/ 'hello'; |
| ^" in "hello" as{TypeError,ForNonNullableByDefault} core::int?; |
| } |
| static method main() → dynamic {} |