d54e2bb568
This CL is the sum of the following 5 CLs: * https://dart-review.googlesource.com/c/sdk/+/170342/ * https://dart-review.googlesource.com/c/sdk/+/170344/ * https://dart-review.googlesource.com/c/sdk/+/170345/ * https://dart-review.googlesource.com/c/sdk/+/170346/ * https://dart-review.googlesource.com/c/sdk/+/170347/ The reason for landing the 5 CLs as one CL is to prevent potential troubles with bisecting over the branch because the change is fully functional only with all 5 CLs. Closes #40122. TEST=Verified by changes in .expect files in pkg/vm/. Bug: https://github.com/dart-lang/sdk/issues/40122 Change-Id: Ib8197802fdc69694387ae47ac990c58b3aaab7a5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170689 Commit-Queue: Dmitry Stefantsov <dmitryas@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
124 lines
6.3 KiB
Plaintext
124 lines
6.3 KiB
Plaintext
library /*isNonNullableByDefault*/;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/nnbd/never_receiver.dart:24:3: Warning: Operand of null-aware operation '?.' has type 'Never' which excludes null.
|
|
// x?.foo(); // Warning.
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/never_receiver.dart:25:3: Warning: Operand of null-aware operation '?.' has type 'Never' which excludes null.
|
|
// x?.bar; // Warning.
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/never_receiver.dart:26:3: Warning: Operand of null-aware operation '?.' has type 'Never' which excludes null.
|
|
// x?.baz = 42; // Warning.
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/never_receiver.dart:27:3: Warning: Operand of null-aware operation '?.' has type 'Never' which excludes null.
|
|
// x?[42]; // Warning.
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/never_receiver.dart:28:3: Warning: Operand of null-aware operation '?.' has type 'Never' which excludes null.
|
|
// x?[42] = 42; // Warning.
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/never_receiver.dart:30:5: Error: The method 'foo' isn't defined for the class 'Never?'.
|
|
// Try correcting the name to the name of an existing method, or defining a method named 'foo'.
|
|
// y.foo(); // Error.
|
|
// ^^^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/never_receiver.dart:31:5: Error: The getter 'bar' isn't defined for the class 'Never?'.
|
|
// Try correcting the name to the name of an existing getter, or defining a getter or field named 'bar'.
|
|
// y.bar; // Error.
|
|
// ^^^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/never_receiver.dart:32:5: Error: The setter 'baz' isn't defined for the class 'Never?'.
|
|
// Try correcting the name to the name of an existing setter, or defining a setter or field named 'baz'.
|
|
// y.baz = 42; // Error.
|
|
// ^^^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/never_receiver.dart:33:4: Error: The method 'call' isn't defined for the class 'Never?'.
|
|
// Try correcting the name to the name of an existing method, or defining a method named 'call'.
|
|
// y(); // Error.
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/never_receiver.dart:34:4: Error: The operator '+' isn't defined for the class 'Never?'.
|
|
// Try correcting the operator to an existing operator, or defining a '+' operator.
|
|
// y++; // Error.
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/never_receiver.dart:35:5: Error: The operator '+' isn't defined for the class 'Never?'.
|
|
// Try correcting the operator to an existing operator, or defining a '+' operator.
|
|
// y += 1; // Error.
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/never_receiver.dart:36:4: Error: The operator '[]' isn't defined for the class 'Never?'.
|
|
// Try correcting the operator to an existing operator, or defining a '[]' operator.
|
|
// y[42]; // Error.
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/never_receiver.dart:37:4: Error: The operator '[]=' isn't defined for the class 'Never?'.
|
|
// Try correcting the operator to an existing operator, or defining a '[]=' operator.
|
|
// y[42] = 42; // Error.
|
|
// ^
|
|
//
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
static method foo(Never x, Never? y) → dynamic {
|
|
core::String local0 = y.{core::Object::toString}();
|
|
core::int local1 = y.{core::Object::hashCode};
|
|
x.foo();
|
|
x.bar;
|
|
x.baz = 42;
|
|
x.call();
|
|
x.[](42);
|
|
x.[]=(42, 42);
|
|
x = x.+(1);
|
|
x = x.+(1);
|
|
let final Never? #t1 = y in #t1.{core::Object::==}(null) ?{Null} null : #t1{Never}.foo();
|
|
let final Never? #t2 = y in #t2.{core::Object::==}(null) ?{Null} null : #t2{Never}.bar;
|
|
let final Never? #t3 = y in #t3.{core::Object::==}(null) ?{core::int?} null : #t3{Never}.baz = 42;
|
|
let final Never? #t4 = y in #t4.{core::Object::==}(null) ?{Null} null : #t4{Never}.call();
|
|
let final Never? #t5 = y in #t5.{core::Object::==}(null) ?{Null} null : #t5{Never}.[](42);
|
|
let final Never? #t6 = y in #t6.{core::Object::==}(null) ?{core::int?} null : #t6{Never}.[]=(42, 42);
|
|
let final Never #t7 = x in #t7.{core::Object::==}(null) ?{Null} null : #t7.foo();
|
|
let final Never #t8 = x in #t8.{core::Object::==}(null) ?{Null} null : #t8.bar;
|
|
let final Never #t9 = x in #t9.{core::Object::==}(null) ?{core::int?} null : #t9.baz = 42;
|
|
let final Never #t10 = x in #t10.{core::Object::==}(null) ?{Null} null : #t10.[](42);
|
|
let final Never #t11 = x in #t11.{core::Object::==}(null) ?{core::int?} null : #t11.[]=(42, 42);
|
|
invalid-expression "pkg/front_end/testcases/nnbd/never_receiver.dart:30:5: Error: The method 'foo' isn't defined for the class 'Never?'.
|
|
Try correcting the name to the name of an existing method, or defining a method named 'foo'.
|
|
y.foo(); // Error.
|
|
^^^";
|
|
invalid-expression "pkg/front_end/testcases/nnbd/never_receiver.dart:31:5: Error: The getter 'bar' isn't defined for the class 'Never?'.
|
|
Try correcting the name to the name of an existing getter, or defining a getter or field named 'bar'.
|
|
y.bar; // Error.
|
|
^^^";
|
|
invalid-expression "pkg/front_end/testcases/nnbd/never_receiver.dart:32:5: Error: The setter 'baz' isn't defined for the class 'Never?'.
|
|
Try correcting the name to the name of an existing setter, or defining a setter or field named 'baz'.
|
|
y.baz = 42; // Error.
|
|
^^^";
|
|
invalid-expression "pkg/front_end/testcases/nnbd/never_receiver.dart:33:4: Error: The method 'call' isn't defined for the class 'Never?'.
|
|
Try correcting the name to the name of an existing method, or defining a method named 'call'.
|
|
y(); // Error.
|
|
^";
|
|
y = invalid-expression "pkg/front_end/testcases/nnbd/never_receiver.dart:34:4: Error: The operator '+' isn't defined for the class 'Never?'.
|
|
Try correcting the operator to an existing operator, or defining a '+' operator.
|
|
y++; // Error.
|
|
^" as{TypeError,ForDynamic,ForNonNullableByDefault} Never?;
|
|
y = invalid-expression "pkg/front_end/testcases/nnbd/never_receiver.dart:35:5: Error: The operator '+' isn't defined for the class 'Never?'.
|
|
Try correcting the operator to an existing operator, or defining a '+' operator.
|
|
y += 1; // Error.
|
|
^" as{TypeError,ForDynamic,ForNonNullableByDefault} Never?;
|
|
invalid-expression "pkg/front_end/testcases/nnbd/never_receiver.dart:36:4: Error: The operator '[]' isn't defined for the class 'Never?'.
|
|
Try correcting the operator to an existing operator, or defining a '[]' operator.
|
|
y[42]; // Error.
|
|
^";
|
|
invalid-expression "pkg/front_end/testcases/nnbd/never_receiver.dart:37:4: Error: The operator '[]=' isn't defined for the class 'Never?'.
|
|
Try correcting the operator to an existing operator, or defining a '[]=' operator.
|
|
y[42] = 42; // Error.
|
|
^";
|
|
}
|
|
static method main() → dynamic {}
|