fdc765faad
TEST=existing Change-Id: I0a8fdf09f742b55357411f12dc6164d4050bb83c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196283 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
33 lines
1.4 KiB
Plaintext
33 lines
1.4 KiB
Plaintext
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);
|
|
}
|
|
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);
|
|
}
|
|
static method test3<S extends core::int>(self::test3::S s) → dynamic {
|
|
core::int t = s.{core::num::+}(1);
|
|
}
|
|
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);
|
|
}
|
|
static method main() → dynamic {}
|