80dacdf3a0
Closes #40440 Change-Id: I2776c165d23e2aa2bf5d7515741bd0f0d067b26d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134292 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Jens Johansen <jensj@google.com>
118 lines
5.0 KiB
Plaintext
118 lines
5.0 KiB
Plaintext
library /*isNonNullableByDefault*/;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:14:3: Warning: Operand of null-aware operation '!' has type 'Class' which excludes null.
|
|
// - 'Class' is from 'pkg/front_end/testcases/nnbd/null_check.dart'.
|
|
// c!.field;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:15:3: Warning: Operand of null-aware operation '!' has type 'Class' which excludes null.
|
|
// - 'Class' is from 'pkg/front_end/testcases/nnbd/null_check.dart'.
|
|
// c!.field = 42;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:16:3: Warning: Operand of null-aware operation '!' has type 'Class' which excludes null.
|
|
// - 'Class' is from 'pkg/front_end/testcases/nnbd/null_check.dart'.
|
|
// c!.method;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:17:3: Warning: Operand of null-aware operation '!' has type 'Class' which excludes null.
|
|
// - 'Class' is from 'pkg/front_end/testcases/nnbd/null_check.dart'.
|
|
// c!.method();
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:18:3: Warning: Operand of null-aware operation '!' has type 'Class' which excludes null.
|
|
// - 'Class' is from 'pkg/front_end/testcases/nnbd/null_check.dart'.
|
|
// c!.field!.toString();
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:19:3: Warning: Operand of null-aware operation '!' has type 'Class' which excludes null.
|
|
// - 'Class' is from 'pkg/front_end/testcases/nnbd/null_check.dart'.
|
|
// c!.method()!.toString();
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:20:3: Warning: Operand of null-aware operation '!' has type 'Class' which excludes null.
|
|
// - 'Class' is from 'pkg/front_end/testcases/nnbd/null_check.dart'.
|
|
// c! + c;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:21:3: Warning: Operand of null-aware operation '!' has type 'Class' which excludes null.
|
|
// - 'Class' is from 'pkg/front_end/testcases/nnbd/null_check.dart'.
|
|
// c! + c!;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:21:8: Warning: Operand of null-aware operation '!' has type 'Class' which excludes null.
|
|
// - 'Class' is from 'pkg/front_end/testcases/nnbd/null_check.dart'.
|
|
// c! + c!;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:22:7: Warning: Operand of null-aware operation '!' has type 'Class' which excludes null.
|
|
// - 'Class' is from 'pkg/front_end/testcases/nnbd/null_check.dart'.
|
|
// c + c!;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:23:6: Warning: Operand of null-aware operation '!' has type 'Class' which excludes null.
|
|
// - 'Class' is from 'pkg/front_end/testcases/nnbd/null_check.dart'.
|
|
// (c + c)!;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:26:10: Warning: Operand of null-aware operation '!' has type 'bool' which excludes null.
|
|
// !o! ? !o! : !!o!!;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:26:17: Warning: Operand of null-aware operation '!' has type 'bool' which excludes null.
|
|
// !o! ? !o! : !!o!!;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:26:18: Warning: Operand of null-aware operation '!' has type 'bool' which excludes null.
|
|
// !o! ? !o! : !!o!!;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:27:5: Warning: Operand of null-aware operation '!' has type 'bool' which excludes null.
|
|
// !(o!) ? (!o)! : (!(!o)!)!;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:27:12: Warning: Operand of null-aware operation '!' has type 'bool' which excludes null.
|
|
// !(o!) ? (!o)! : (!(!o)!)!;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:27:22: Warning: Operand of null-aware operation '!' has type 'bool' which excludes null.
|
|
// !(o!) ? (!o)! : (!(!o)!)!;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/null_check.dart:27:20: Warning: Operand of null-aware operation '!' has type 'bool' which excludes null.
|
|
// !(o!) ? (!o)! : (!(!o)!)!;
|
|
// ^
|
|
//
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
class Class extends core::Object {
|
|
field core::int? field = null;
|
|
synthetic constructor •() → self::Class
|
|
: super core::Object::•()
|
|
;
|
|
method method() → core::int?
|
|
return this.{self::Class::field};
|
|
operator +(self::Class other) → self::Class
|
|
return new self::Class::•();
|
|
}
|
|
static method main() → dynamic {
|
|
self::Class? c = new self::Class::•();
|
|
c!;
|
|
c{self::Class}!.{self::Class::field};
|
|
c{self::Class}!.{self::Class::field} = 42;
|
|
c{self::Class}!.{self::Class::method};
|
|
c{self::Class}!.{self::Class::method}();
|
|
c{self::Class}!.{self::Class::field}!.{core::int::toString}();
|
|
c{self::Class}!.{self::Class::method}()!.{core::int::toString}();
|
|
c{self::Class}!.{self::Class::+}(c{self::Class});
|
|
c{self::Class}!.{self::Class::+}(c{self::Class}!);
|
|
c{self::Class}.{self::Class::+}(c{self::Class}!);
|
|
c{self::Class}.{self::Class::+}(c{self::Class})!;
|
|
core::bool? o = true;
|
|
!o! ?{core::bool} !o{core::bool}! : !!o{core::bool}!!;
|
|
!o{core::bool}! ?{core::bool} (!o{core::bool})! : (!(!o{core::bool})!)!;
|
|
}
|