| library /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/nnbd/type_constraint_solving_closures_in_upper_and_lower_bounds.dart:15:14: Error: A value of type 'int' can't be assigned to a variable of type 'String'. |
| // String s = x; // Should be an error, `T` should be int. |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| class C<X extends core::Object? = dynamic> extends core::Object { |
| constructor •((self::C::X%) → void x) → self::C<self::C::X%> |
| : super core::Object::•() |
| ; |
| } |
| static method check<T extends core::Object? = dynamic>(self::C<core::List<self::check::T%>> f) → self::check::T% { |
| return let Null #t1 = null in #t1.==(null) ?{self::check::T%} #t1 as{ForNonNullableByDefault} self::check::T% : #t1{self::check::T%}; |
| } |
| static method test() → void { |
| core::int x = self::check<core::int>(new self::C::•<core::List<core::int>>((core::List<core::int> x) → void {})); |
| core::String s = let final Never #t2 = invalid-expression "pkg/front_end/testcases/nnbd/type_constraint_solving_closures_in_upper_and_lower_bounds.dart:15:14: Error: A value of type 'int' can't be assigned to a variable of type 'String'. |
| String s = x; // Should be an error, `T` should be int. |
| ^" in x as{TypeError,ForNonNullableByDefault} core::String; |
| } |
| static method main() → dynamic {} |
| |
| |
| Extra constant evaluation status: |
| Evaluated: MethodInvocation @ org-dartlang-testcase:///type_constraint_solving_closures_in_upper_and_lower_bounds.dart:10:3 -> BoolConstant(true) |
| Evaluated: VariableGet @ org-dartlang-testcase:///type_constraint_solving_closures_in_upper_and_lower_bounds.dart:10:15 -> NullConstant(null) |
| Evaluated: VariableGet @ org-dartlang-testcase:///type_constraint_solving_closures_in_upper_and_lower_bounds.dart:10:3 -> NullConstant(null) |
| Extra constant evaluation: evaluated: 12, effectively constant: 3 |