| library /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/nnbd/issue41697b.dart:10:13: Error: Operator '+' cannot be called on 'S' because it is potentially null. |
| // var t = s + 1; // error |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/issue41697b.dart:18:13: Error: Operator '+' cannot be called on 'S' because it is potentially null. |
| // var t = s + 1; // error |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| static method test1<S extends core::num>(self::test1::S s) → dynamic { |
| core::num t = s.{core::num::+}(1){(core::num) → core::num}; |
| } |
| static method test2<S extends core::num?>(self::test2::S% s) → dynamic { |
| core::num t = let final Never #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697b.dart:10:13: Error: Operator '+' cannot be called on 'S' because it is potentially null. |
| var t = s + 1; // error |
| ^" in s.{core::num::+}(1){(core::num) → core::num}; |
| } |
| static method test3<S extends core::int>(self::test3::S s) → dynamic { |
| core::int t = s.{core::num::+}(1){(core::num) → core::int}; |
| } |
| static method test4<S extends core::int?>(self::test4::S% s) → dynamic { |
| core::num t = let final Never #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41697b.dart:18:13: Error: Operator '+' cannot be called on 'S' because it is potentially null. |
| var t = s + 1; // error |
| ^" in s.{core::num::+}(1){(core::num) → core::num}; |
| } |
| static method main() → dynamic {} |