Clean up null-aware tests.

Change-Id: I0e932695b00dc8fab34fbbeada5777cb4534150e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162510
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
This commit is contained in:
Lasse R.H. Nielsen 2021-05-12 15:21:10 +00:00 committed by commit-bot@chromium.org
parent d9ff433081
commit 46b3b6352d
64 changed files with 238 additions and 5499 deletions

View file

@ -712,14 +712,14 @@ class Expect {
/// because the types appear to be unrelated.
static void _subtypeAtRuntime<Sub, Super>() {
if (<Sub>[] is! List<Super>) {
fail("$Sub is not a subtype of $Super");
_fail("Expect.subtype<$Sub, $Super>: $Sub is not a subtype of $Super");
}
}
/// Checks that `Sub` is not a subtype of `Super` at run time.
static void notSubtype<Sub, Super>() {
if (<Sub>[] is List<Super>) {
fail("$Sub is a subtype of $Super");
_fail("Expect.notSubtype<$Sub, $Super>: $Sub is a subtype of $Super");
}
}
@ -727,7 +727,7 @@ class Expect {
(reason.isEmpty) ? "" : ", '$reason'";
@alwaysThrows
static void _fail(String message) {
static Never _fail(String message) {
throw new ExpectException(message);
}
}

View file

@ -1967,67 +1967,11 @@
"../../../tests/language/null/null2_test.dart",
"../../../tests/language/null/to_string2_test.dart",
"../../../tests/language/null/to_string_test.dart",
"../../../tests/language/null_aware/access_runtime_1_test.dart",
"../../../tests/language/null_aware/access_runtime_2_test.dart",
"../../../tests/language/null_aware/access_runtime_3_test.dart",
"../../../tests/language/null_aware/access_runtime_4_test.dart",
"../../../tests/language/null_aware/access_runtime_5_test.dart",
"../../../tests/language/null_aware/access_runtime_6_test.dart",
"../../../tests/language/null_aware/access_runtime_7_test.dart",
"../../../tests/language/null_aware/access_runtime_test.dart",
"../../../tests/language/null_aware/assignment_runtime_10_test.dart",
"../../../tests/language/null_aware/assignment_runtime_11_test.dart",
"../../../tests/language/null_aware/assignment_runtime_12_test.dart",
"../../../tests/language/null_aware/assignment_runtime_13_test.dart",
"../../../tests/language/null_aware/assignment_runtime_1_test.dart",
"../../../tests/language/null_aware/assignment_runtime_2_test.dart",
"../../../tests/language/null_aware/assignment_runtime_3_test.dart",
"../../../tests/language/null_aware/assignment_runtime_4_test.dart",
"../../../tests/language/null_aware/assignment_runtime_5_test.dart",
"../../../tests/language/null_aware/assignment_runtime_6_test.dart",
"../../../tests/language/null_aware/assignment_runtime_7_test.dart",
"../../../tests/language/null_aware/assignment_runtime_8_test.dart",
"../../../tests/language/null_aware/assignment_runtime_9_test.dart",
"../../../tests/language/null_aware/assignment_runtime_test.dart",
"../../../tests/language/null_aware/dynamic_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_10_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_11_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_12_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_13_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_14_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_15_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_16_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_17_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_18_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_19_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_1_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_20_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_21_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_22_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_23_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_24_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_25_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_26_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_27_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_28_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_2_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_3_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_4_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_5_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_6_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_7_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_8_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_9_test.dart",
"../../../tests/language/null_aware/increment_decrement_runtime_test.dart",
"../../../tests/language/null_aware/index_this_null_aware_equals_test.dart",
"../../../tests/language/null_aware/invocation_runtime_1_test.dart",
"../../../tests/language/null_aware/invocation_runtime_2_test.dart",
"../../../tests/language/null_aware/invocation_runtime_3_test.dart",
"../../../tests/language/null_aware/invocation_runtime_4_test.dart",
"../../../tests/language/null_aware/invocation_runtime_5_test.dart",
"../../../tests/language/null_aware/invocation_runtime_6_test.dart",
"../../../tests/language/null_aware/invocation_runtime_7_test.dart",
"../../../tests/language/null_aware/invocation_runtime_8_test.dart",
"../../../tests/language/null_aware/invocation_runtime_test.dart",
"../../../tests/language/null_aware/null_shortening_test.dart",
"../../../tests/language/null_aware/opt_test.dart",

View file

@ -1,58 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it does not appear on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class B {}
class C extends B {
int? v;
C(this.v);
static int? staticInt;
}
C? nullC() => null;
main() {
// Make sure the "none" test fails if property access using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.v;
// e1?.id is equivalent to ((x) => x == null ? null : x.id)(e1).
Expect.equals(null, nullC()?.v);
// C?.id is equivalent to C.id.
// The static type of e1?.d is the static type of e1.id.
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.id are also
// generated in the case of e1?.id.
// '?.' cannot be used to access toplevel properties in libraries imported via
// prefix.
// Nor can it be used to access the hashCode getter on the class Type.
}

View file

@ -1,59 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it does not appear on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class B {}
class C extends B {
int? v;
C(this.v);
static int? staticInt;
}
C? nullC() => null;
main() {
// Make sure the "none" test fails if property access using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.v;
// e1?.id is equivalent to ((x) => x == null ? null : x.id)(e1).
var c = new C(1) as C?;
Expect.equals(1, c?.v);
// C?.id is equivalent to C.id.
// The static type of e1?.d is the static type of e1.id.
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.id are also
// generated in the case of e1?.id.
// '?.' cannot be used to access toplevel properties in libraries imported via
// prefix.
// Nor can it be used to access the hashCode getter on the class Type.
}

View file

@ -1,58 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it does not appear on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class B {}
class C extends B {
int? v;
C(this.v);
static int? staticInt;
}
C? nullC() => null;
main() {
// Make sure the "none" test fails if property access using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.v;
// e1?.id is equivalent to ((x) => x == null ? null : x.id)(e1).
// C?.id is equivalent to C.id.
{ C.staticInt = 1; Expect.equals(1, C?.staticInt); }
// The static type of e1?.d is the static type of e1.id.
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.id are also
// generated in the case of e1?.id.
// '?.' cannot be used to access toplevel properties in libraries imported via
// prefix.
// Nor can it be used to access the hashCode getter on the class Type.
}

View file

@ -1,58 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it does not appear on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class B {}
class C extends B {
int? v;
C(this.v);
static int? staticInt;
}
C? nullC() => null;
main() {
// Make sure the "none" test fails if property access using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.v;
// e1?.id is equivalent to ((x) => x == null ? null : x.id)(e1).
// C?.id is equivalent to C.id.
{ h.C.staticInt = 1; Expect.equals(1, h.C?.staticInt); }
// The static type of e1?.d is the static type of e1.id.
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.id are also
// generated in the case of e1?.id.
// '?.' cannot be used to access toplevel properties in libraries imported via
// prefix.
// Nor can it be used to access the hashCode getter on the class Type.
}

View file

@ -1,59 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it does not appear on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class B {}
class C extends B {
int? v;
C(this.v);
static int? staticInt;
}
C? nullC() => null;
main() {
// Make sure the "none" test fails if property access using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.v;
// e1?.id is equivalent to ((x) => x == null ? null : x.id)(e1).
// C?.id is equivalent to C.id.
// The static type of e1?.d is the static type of e1.id.
var c = new C(1) as C?;
{ int? i = c?.v; Expect.equals(1, i); }
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.id are also
// generated in the case of e1?.id.
// '?.' cannot be used to access toplevel properties in libraries imported via
// prefix.
// Nor can it be used to access the hashCode getter on the class Type.
}

View file

@ -1,58 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it does not appear on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class B {}
class C extends B {
int? v;
C(this.v);
static int? staticInt;
}
C? nullC() => null;
main() {
// Make sure the "none" test fails if property access using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.v;
// e1?.id is equivalent to ((x) => x == null ? null : x.id)(e1).
// C?.id is equivalent to C.id.
// The static type of e1?.d is the static type of e1.id.
{ C.staticInt = 1; int? i = C?.staticInt; Expect.equals(1, i); }
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.id are also
// generated in the case of e1?.id.
// '?.' cannot be used to access toplevel properties in libraries imported via
// prefix.
// Nor can it be used to access the hashCode getter on the class Type.
}

View file

@ -1,58 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it does not appear on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class B {}
class C extends B {
int? v;
C(this.v);
static int? staticInt;
}
C? nullC() => null;
main() {
// Make sure the "none" test fails if property access using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.v;
// e1?.id is equivalent to ((x) => x == null ? null : x.id)(e1).
// C?.id is equivalent to C.id.
// The static type of e1?.d is the static type of e1.id.
{ h.C.staticInt = 1; int? i = h.C?.staticInt; Expect.equals(1, i); }
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.id are also
// generated in the case of e1?.id.
// '?.' cannot be used to access toplevel properties in libraries imported via
// prefix.
// Nor can it be used to access the hashCode getter on the class Type.
}

View file

@ -1,6 +1,3 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@ -22,37 +19,34 @@ class C extends B {
C? nullC() => null;
main() {
// Make sure the "none" test fails if property access using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.v;
// e1?.id is equivalent to ((x) => x == null ? null : x.id)(e1).
Expect.equals(null, nullC()?.v);
C? c = new C(1) as dynamic;
Expect.equals(1, c?.v);
// C?.id is equivalent to C.id.
C.staticInt = 1;
Expect.equals(1, C?.staticInt);
h.C.staticInt = 1;
Expect.equals(1, h.C?.staticInt);
// The static type of e1?.id is the static type of e1.id.
{
int? i = c?.v;
Expect.equals(1, i);
}
// The static type of e1?.d is the static type of e1.id.
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.id are also
// generated in the case of e1?.id.
// '?.' cannot be used to access toplevel properties in libraries imported via
// prefix.
// Nor can it be used to access the hashCode getter on the class Type.
{
C.staticInt = 1;
int? i = C?.staticInt;
Expect.equals(1, i);
}
{
h.C.staticInt = 1;
int? i = h.C?.staticInt;
Expect.equals(1, i);
}
}

View file

@ -110,7 +110,7 @@ main() {
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
// [cfe] The getter 'bad' isn't defined for the class 'C'.
{
var b = new C(1) as B?;
B? b = new C(1) as dynamic;
Expect.equals(1, b?.v);
// ^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER

View file

@ -1,101 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v = e2 is equivalent to ((x) => x == null ? null : x.v = e2)(e1).
// C?.v = e2 is equivalent to C.v = e2.
// The static type of e1?.v = e2 is the static type of e2.
// Exactly the same errors that would be caused by e1.v = e2 are
// also generated in the case of e1?.v = e2.
// e1?.v op= e2 is equivalent to ((x) => x?.v = x.v op e2)(e1).
// C?.v op= e2 is equivalent to C.v op= e2.
{ C.staticInt = 1; Expect.equals(3, C?.staticInt += 2); Expect.equals(3, C?.staticInt); }
// The static type of e1?.v op= e2 is the static type of e1.v op e2.
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same errors that would be caused by y.v op e2 are
// also generated in the case of e1?.v op= e2.
// '?.' cannot be used to assign to toplevel properties in libraries imported
// via prefix.
}

View file

@ -1,101 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v = e2 is equivalent to ((x) => x == null ? null : x.v = e2)(e1).
// C?.v = e2 is equivalent to C.v = e2.
// The static type of e1?.v = e2 is the static type of e2.
// Exactly the same errors that would be caused by e1.v = e2 are
// also generated in the case of e1?.v = e2.
// e1?.v op= e2 is equivalent to ((x) => x?.v = x.v op e2)(e1).
// C?.v op= e2 is equivalent to C.v op= e2.
// The static type of e1?.v op= e2 is the static type of e1.v op e2.
{ var d = new D(new E()) as D?; F? f = (d?.v += 1); Expect.identical(d!.v, f); }
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same errors that would be caused by y.v op e2 are
// also generated in the case of e1?.v op= e2.
// '?.' cannot be used to assign to toplevel properties in libraries imported
// via prefix.
}

View file

@ -1,101 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v = e2 is equivalent to ((x) => x == null ? null : x.v = e2)(e1).
// C?.v = e2 is equivalent to C.v = e2.
// The static type of e1?.v = e2 is the static type of e2.
// Exactly the same errors that would be caused by e1.v = e2 are
// also generated in the case of e1?.v = e2.
// e1?.v op= e2 is equivalent to ((x) => x?.v = x.v op e2)(e1).
// C?.v op= e2 is equivalent to C.v op= e2.
// The static type of e1?.v op= e2 is the static type of e1.v op e2.
{ D.staticE = new E(); F? f = (D?.staticE += 1); Expect.identical(D.staticE, f); }
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same errors that would be caused by y.v op e2 are
// also generated in the case of e1?.v op= e2.
// '?.' cannot be used to assign to toplevel properties in libraries imported
// via prefix.
}

View file

@ -1,101 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v = e2 is equivalent to ((x) => x == null ? null : x.v = e2)(e1).
// C?.v = e2 is equivalent to C.v = e2.
// The static type of e1?.v = e2 is the static type of e2.
// Exactly the same errors that would be caused by e1.v = e2 are
// also generated in the case of e1?.v = e2.
// e1?.v op= e2 is equivalent to ((x) => x?.v = x.v op e2)(e1).
// C?.v op= e2 is equivalent to C.v op= e2.
// The static type of e1?.v op= e2 is the static type of e1.v op e2.
{ h.D.staticE = new h.E(); h.F? f = (h.D?.staticE += 1); Expect.identical(h.D.staticE, f); }
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same errors that would be caused by y.v op e2 are
// also generated in the case of e1?.v op= e2.
// '?.' cannot be used to assign to toplevel properties in libraries imported
// via prefix.
}

View file

@ -1,101 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v = e2 is equivalent to ((x) => x == null ? null : x.v = e2)(e1).
Expect.equals(null, nullC()?.v = bad());
// C?.v = e2 is equivalent to C.v = e2.
// The static type of e1?.v = e2 is the static type of e2.
// Exactly the same errors that would be caused by e1.v = e2 are
// also generated in the case of e1?.v = e2.
// e1?.v op= e2 is equivalent to ((x) => x?.v = x.v op e2)(e1).
// C?.v op= e2 is equivalent to C.v op= e2.
// The static type of e1?.v op= e2 is the static type of e1.v op e2.
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same errors that would be caused by y.v op e2 are
// also generated in the case of e1?.v op= e2.
// '?.' cannot be used to assign to toplevel properties in libraries imported
// via prefix.
}

View file

@ -1,101 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v = e2 is equivalent to ((x) => x == null ? null : x.v = e2)(e1).
{ var c = new C(1) as C?; Expect.equals(2, c?.v = 2); Expect.equals(2, c!.v); }
// C?.v = e2 is equivalent to C.v = e2.
// The static type of e1?.v = e2 is the static type of e2.
// Exactly the same errors that would be caused by e1.v = e2 are
// also generated in the case of e1?.v = e2.
// e1?.v op= e2 is equivalent to ((x) => x?.v = x.v op e2)(e1).
// C?.v op= e2 is equivalent to C.v op= e2.
// The static type of e1?.v op= e2 is the static type of e1.v op e2.
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same errors that would be caused by y.v op e2 are
// also generated in the case of e1?.v op= e2.
// '?.' cannot be used to assign to toplevel properties in libraries imported
// via prefix.
}

View file

@ -1,101 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v = e2 is equivalent to ((x) => x == null ? null : x.v = e2)(e1).
// C?.v = e2 is equivalent to C.v = e2.
{ C.staticInt = 1; Expect.equals(2, C?.staticInt = 2); Expect.equals(2, C.staticInt); }
// The static type of e1?.v = e2 is the static type of e2.
// Exactly the same errors that would be caused by e1.v = e2 are
// also generated in the case of e1?.v = e2.
// e1?.v op= e2 is equivalent to ((x) => x?.v = x.v op e2)(e1).
// C?.v op= e2 is equivalent to C.v op= e2.
// The static type of e1?.v op= e2 is the static type of e1.v op e2.
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same errors that would be caused by y.v op e2 are
// also generated in the case of e1?.v op= e2.
// '?.' cannot be used to assign to toplevel properties in libraries imported
// via prefix.
}

View file

@ -1,101 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v = e2 is equivalent to ((x) => x == null ? null : x.v = e2)(e1).
// C?.v = e2 is equivalent to C.v = e2.
{ h.C.staticInt = 1; Expect.equals(2, h.C?.staticInt = 2); Expect.equals(2, h.C.staticInt); }
// The static type of e1?.v = e2 is the static type of e2.
// Exactly the same errors that would be caused by e1.v = e2 are
// also generated in the case of e1?.v = e2.
// e1?.v op= e2 is equivalent to ((x) => x?.v = x.v op e2)(e1).
// C?.v op= e2 is equivalent to C.v op= e2.
// The static type of e1?.v op= e2 is the static type of e1.v op e2.
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same errors that would be caused by y.v op e2 are
// also generated in the case of e1?.v op= e2.
// '?.' cannot be used to assign to toplevel properties in libraries imported
// via prefix.
}

View file

@ -1,101 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v = e2 is equivalent to ((x) => x == null ? null : x.v = e2)(e1).
// C?.v = e2 is equivalent to C.v = e2.
// The static type of e1?.v = e2 is the static type of e2.
{ var d = new D(new E()) as D?; G g = new G(); F? f = (d?.v = g); Expect.identical(f, g); }
// Exactly the same errors that would be caused by e1.v = e2 are
// also generated in the case of e1?.v = e2.
// e1?.v op= e2 is equivalent to ((x) => x?.v = x.v op e2)(e1).
// C?.v op= e2 is equivalent to C.v op= e2.
// The static type of e1?.v op= e2 is the static type of e1.v op e2.
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same errors that would be caused by y.v op e2 are
// also generated in the case of e1?.v op= e2.
// '?.' cannot be used to assign to toplevel properties in libraries imported
// via prefix.
}

View file

@ -1,101 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v = e2 is equivalent to ((x) => x == null ? null : x.v = e2)(e1).
// C?.v = e2 is equivalent to C.v = e2.
// The static type of e1?.v = e2 is the static type of e2.
{ D.staticE = new E(); G g = new G(); F? f = (D?.staticE = g); Expect.identical(f, g); }
// Exactly the same errors that would be caused by e1.v = e2 are
// also generated in the case of e1?.v = e2.
// e1?.v op= e2 is equivalent to ((x) => x?.v = x.v op e2)(e1).
// C?.v op= e2 is equivalent to C.v op= e2.
// The static type of e1?.v op= e2 is the static type of e1.v op e2.
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same errors that would be caused by y.v op e2 are
// also generated in the case of e1?.v op= e2.
// '?.' cannot be used to assign to toplevel properties in libraries imported
// via prefix.
}

View file

@ -1,101 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v = e2 is equivalent to ((x) => x == null ? null : x.v = e2)(e1).
// C?.v = e2 is equivalent to C.v = e2.
// The static type of e1?.v = e2 is the static type of e2.
{ h.D.staticE = new h.E(); h.G g = new h.G(); h.F? f = (h.D?.staticE = g); Expect.identical(f, g); }
// Exactly the same errors that would be caused by e1.v = e2 are
// also generated in the case of e1?.v = e2.
// e1?.v op= e2 is equivalent to ((x) => x?.v = x.v op e2)(e1).
// C?.v op= e2 is equivalent to C.v op= e2.
// The static type of e1?.v op= e2 is the static type of e1.v op e2.
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same errors that would be caused by y.v op e2 are
// also generated in the case of e1?.v op= e2.
// '?.' cannot be used to assign to toplevel properties in libraries imported
// via prefix.
}

View file

@ -1,102 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
int bad() {
Expect.fail('Should not be executed');
return -1;
}
class B {}
class C extends B {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v = e2 is equivalent to ((x) => x == null ? null : x.v = e2)(e1).
// C?.v = e2 is equivalent to C.v = e2.
// The static type of e1?.v = e2 is the static type of e2.
// Exactly the same errors that would be caused by e1.v = e2 are
// also generated in the case of e1?.v = e2.
// e1?.v op= e2 is equivalent to ((x) => x?.v = x.v op e2)(e1).
Expect.equals(null, nullC()?.v += bad());
// C?.v op= e2 is equivalent to C.v op= e2.
// The static type of e1?.v op= e2 is the static type of e1.v op e2.
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same errors that would be caused by y.v op e2 are
// also generated in the case of e1?.v op= e2.
// '?.' cannot be used to assign to toplevel properties in libraries imported
// via prefix.
}

View file

@ -1,101 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears on the LHS of an
// assignment.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v = e2 is equivalent to ((x) => x == null ? null : x.v = e2)(e1).
// C?.v = e2 is equivalent to C.v = e2.
// The static type of e1?.v = e2 is the static type of e2.
// Exactly the same errors that would be caused by e1.v = e2 are
// also generated in the case of e1?.v = e2.
// e1?.v op= e2 is equivalent to ((x) => x?.v = x.v op e2)(e1).
{ var c = new C(1) as C?; Expect.equals(3, c?.v += 2); Expect.equals(3, c!.v); }
// C?.v op= e2 is equivalent to C.v op= e2.
// The static type of e1?.v op= e2 is the static type of e1.v op e2.
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same errors that would be caused by y.v op e2 are
// also generated in the case of e1?.v op= e2.
// '?.' cannot be used to assign to toplevel properties in libraries imported
// via prefix.
}

View file

@ -1,6 +1,3 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@ -18,7 +15,7 @@ bad() {
class B {}
class C extends B {
int v;
num v;
C(this.v);
static late int staticInt;
}
@ -44,58 +41,75 @@ class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v = e2 is equivalent to ((x) => x == null ? null : x.v = e2)(e1).
Expect.equals(null, nullC()?.v = bad());
{
C? c = new C(1) as dynamic;
Expect.equals(2, c?.v = 2);
Expect.equals(2, c!.v);
}
// C?.v = e2 is equivalent to C.v = e2.
C.staticInt = 1;
Expect.equals(2, C?.staticInt = 2);
Expect.equals(2, C.staticInt);
h.C.staticInt = 1;
Expect.equals(2, h.C?.staticInt = 2);
Expect.equals(2, h.C.staticInt);
// The static type of e1?.v = e2 is the static type of e2.
{
D? d = new D(new E()) as dynamic;
G g = new G();
F? f = (d?.v = g);
Expect.identical(f, g);
}
{
D.staticE = new E();
G g = new G();
F? f = (D?.staticE = g);
Expect.identical(f, g);
}
h.D.staticE = new h.E();
h.G g = new h.G();
h.F? f = (h.D?.staticE = g);
Expect.identical(f, g);
// Exactly the same errors that would be caused by e1.v = e2 are
// also generated in the case of e1?.v = e2.
// e1?.v op= e2 is equivalent to ((x) => x?.v = x.v op e2)(e1).
Expect.equals(null, nullC()?.v += bad());
{
C? c = new C(1) as dynamic;
Expect.equals(3, c?.v += 2);
Expect.equals(3, c!.v);
}
// C?.v op= e2 is equivalent to C.v op= e2.
C.staticInt = 1;
Expect.equals(3, C?.staticInt += 2);
Expect.equals(3, C?.staticInt);
// The static type of e1?.v op= e2 is the static type of e1.v op e2.
{
D? d = new D(new E()) as dynamic;
F? f = (d?.v += 1);
Expect.identical(d!.v, f);
}
{
D.staticE = new E();
F? f = (D?.staticE += 1);
Expect.identical(D.staticE, f);
}
// Let T be the static type of e1 and let y be a fresh variable of type T.
// Exactly the same errors that would be caused by y.v op e2 are
// also generated in the case of e1?.v op= e2.
// '?.' cannot be used to assign to toplevel properties in libraries imported
// via prefix.
{
h.D.staticE = new h.E();
h.F? f = (h.D?.staticE += 1);
Expect.identical(h.D.staticE, f);
}
}

View file

@ -76,13 +76,13 @@ main() {
// The static type of e1?.v = e2 is the static type of e2.
{
var d = new D(new E()) as D?;
D? d = new D(new E()) as dynamic;
G g = new G();
F? f = (d?.v = g);
Expect.identical(f, g);
}
{
var d = new D(new E()) as D?;
D? d = new D(new E()) as dynamic;
E e = new G();
F? f = (d?.v = e);
// ^^^^^^^^
@ -201,17 +201,16 @@ main() {
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER
// [cfe] The setter 'bad' isn't defined for the class 'C'.
{
B b = new C(1);
b?.v += 2;
B bname = new C(1);
bname?.v += 2;
// ^
// [cfe] Operand of null-aware operation '?.' has type 'B' which excludes null.
// ^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// ^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
// [cfe] The getter 'v' isn't defined for the class 'B'.
// ^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_SETTER
// [cfe] The getter 'v' isn't defined for the class 'B'.
// [cfe] The setter 'v' isn't defined for the class 'B'.
}
{
@ -231,7 +230,6 @@ main() {
// ^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
// [cfe] A value of type 'G?' can't be assigned to a variable of type 'H?'.
// ^
// [cfe] Operand of null-aware operation '?.' has type 'D' which excludes null.
// ^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
{ C.staticInt = 1; Expect.equals(1, C?.staticInt--); Expect.equals(0, C.staticInt); }
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
{ h.C.staticInt = 1; Expect.equals(1, h.C?.staticInt--); Expect.equals(0, h.C.staticInt); }
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
{ E e1 = new E(); var d = new D(e1) as D?; E? e2 = d?.v--; Expect.identical(e1, e2); }
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
{ E e1 = new E(); D.staticE = e1; E? e2 = D?.staticE--; Expect.identical(e1, e2); }
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
{ h.E e1 = new h.E(); h.D.staticE = e1; h.E? e2 = h.D?.staticE--; Expect.identical(e1, e2); }
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
Expect.equals(null, ++nullC()?.v);
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
{ var c = new C(1) as C?; Expect.equals(2, ++c?.v); Expect.equals(2, c!.v); }
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
{ C.staticInt = 1; Expect.equals(2, ++C?.staticInt); Expect.equals(2, C.staticInt); }
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
{ h.C.staticInt = 1; Expect.equals(2, ++h.C?.staticInt); Expect.equals(2, h.C.staticInt); }
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
{ var d = new D(new E()) as D?; F? f = ++d?.v; Expect.identical(d!.v, f); }
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
Expect.equals(null, nullC()?.v++);
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
{ D.staticE = new E(); F? f = ++D?.staticE; Expect.identical(D.staticE, f); }
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
{ h.D.staticE = new h.E(); h.F? f = ++h.D?.staticE; Expect.identical(h.D.staticE, f); }
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
Expect.equals(null, --nullC()?.v);
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
{ var c = new C(1) as C?; Expect.equals(0, --c?.v); Expect.equals(0, c!.v); }
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
{ C.staticInt = 1; Expect.equals(0, --C?.staticInt); Expect.equals(0, C.staticInt); }
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
{ h.C.staticInt = 1; Expect.equals(0, --h.C?.staticInt); Expect.equals(0, h.C.staticInt); }
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
{ var d = new D(new E()) as D?; F? f = --d?.v; Expect.identical(d!.v, f); }
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
{ D.staticE = new E(); F? f = --D?.staticE; Expect.identical(D.staticE, f); }
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
{ h.D.staticE = new h.E(); h.F? f = --h.D?.staticE; Expect.identical(h.D.staticE, f); }
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
{ var c = new C(1) as C?; Expect.equals(1, c?.v++); Expect.equals(2, c!.v); }
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
{ C.staticInt = 1; Expect.equals(1, C?.staticInt++); Expect.equals(2, C.staticInt); }
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
{ h.C.staticInt = 1; Expect.equals(1, h.C?.staticInt++); Expect.equals(2, h.C.staticInt); }
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
{ E e1 = new E(); var d = new D(e1) as D?; E? e2 = d?.v++; Expect.identical(e1, e2); }
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
{ E e1 = new E(); D.staticE = e1; E? e2 = D?.staticE++; Expect.identical(e1, e2); }
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
{ h.E e1 = new h.E(); h.D.staticE = e1; h.E? e2 = h.D?.staticE++; Expect.identical(e1, e2); }
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
Expect.equals(null, nullC()?.v--);
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -1,109 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it appears in a postincrement or
// preincrement expression (or a postdecrement or predecrement expression).
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
class C {
int v;
C(this.v);
static late int staticInt;
}
class D {
E v;
D(this.v);
static late E staticE;
}
class E {
G operator +(int i) => new I();
G operator -(int i) => new I();
}
class F {}
class G extends E implements F {}
class H {}
class I extends G implements H {}
C? nullC() => null;
main() {
// Make sure the "none" test fails if assignment to "?." is not implemented.
// This makes status files easier to maintain.
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
// C?.v++ is equivalent to C.v++.
// The static type of e1?.v++ is the same as the static type of e1.v.
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
{ var c = new C(1) as C?; Expect.equals(1, c?.v--); Expect.equals(0, c!.v); }
// C?.v-- is equivalent to C.v--.
// The static type of e1?.v-- is the same as the static type of e1.v.
// ++e1?.v is equivalent to e1?.v += 1.
// ++C?.v is equivalent to C?.v += 1.
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
// --e1?.v is equivalent to e1?.v -= 1.
// --C?.v is equivalent to C?.v -= 1.
// The static type of --e1?.v is the same as the static type of e1.v - 1.
}

View file

@ -44,66 +44,161 @@ main() {
nullC()?.v = 1;
// e1?.v++ is equivalent to ((x) => x == null ? null : x.v++)(e1).
Expect.equals(null, nullC()?.v++);
{
C? c = new C(1) as dynamic;
Expect.equals(1, c?.v++);
Expect.equals(2, c!.v);
}
// C?.v++ is equivalent to C.v++.
{
C.staticInt = 1;
Expect.equals(1, C?.staticInt++);
Expect.equals(2, C.staticInt);
}
{
h.C.staticInt = 1;
Expect.equals(1, h.C?.staticInt++);
Expect.equals(2, h.C.staticInt);
}
// The static type of e1?.v++ is the same as the static type of e1.v.
{
E e1 = new E();
D? d = new D(e1) as dynamic;
E? e2 = d?.v++;
Expect.identical(e1, e2);
}
{
E e1 = new E();
D.staticE = e1;
E? e2 = D?.staticE++;
Expect.identical(e1, e2);
}
{
h.E e1 = new h.E();
h.D.staticE = e1;
h.E? e2 = h.D?.staticE++;
Expect.identical(e1, e2);
}
// e1?.v-- is equivalent to ((x) => x == null ? null : x.v--)(e1).
Expect.equals(null, nullC()?.v--);
{
C? c = new C(1) as dynamic;
Expect.equals(1, c?.v--);
Expect.equals(0, c!.v);
}
// C?.v-- is equivalent to C.v--.
{
C.staticInt = 1;
Expect.equals(1, C?.staticInt--);
Expect.equals(0, C.staticInt);
}
{
h.C.staticInt = 1;
Expect.equals(1, h.C?.staticInt--);
Expect.equals(0, h.C.staticInt);
}
// The static type of e1?.v-- is the same as the static type of e1.v.
{
E e1 = new E();
D? d = new D(e1) as dynamic;
E? e2 = d?.v--;
Expect.identical(e1, e2);
}
{
E e1 = new E();
D.staticE = e1;
E? e2 = D?.staticE--;
Expect.identical(e1, e2);
}
{
h.E e1 = new h.E();
h.D.staticE = e1;
h.E? e2 = h.D?.staticE--;
Expect.identical(e1, e2);
}
// ++e1?.v is equivalent to e1?.v += 1.
Expect.equals(null, ++nullC()?.v);
{
C? c = new C(1) as dynamic;
Expect.equals(2, ++c?.v);
Expect.equals(2, c!.v);
}
// ++C?.v is equivalent to C?.v += 1.
{
C.staticInt = 1;
Expect.equals(2, ++C?.staticInt);
Expect.equals(2, C.staticInt);
}
{
h.C.staticInt = 1;
Expect.equals(2, ++h.C?.staticInt);
Expect.equals(2, h.C.staticInt);
}
// The static type of ++e1?.v is the same as the static type of e1.v + 1.
{
D? d = new D(new E()) as dynamic;
F? f = ++d?.v;
Expect.identical(d!.v, f);
}
{
D? d = new D(new E()) as dynamic;
F? f = ++d?.v;
Expect.identical(d!.v, f);
}
{
h.D.staticE = new h.E();
h.F? f = ++h.D?.staticE;
Expect.identical(h.D.staticE, f);
}
// --e1?.v is equivalent to e1?.v -= 1.
Expect.equals(null, --nullC()?.v);
{
C? c = new C(1) as dynamic;
Expect.equals(0, --c?.v);
Expect.equals(0, c!.v);
}
// --C?.v is equivalent to C?.v -= 1.
{
C.staticInt = 1;
Expect.equals(0, --C?.staticInt);
Expect.equals(0, C.staticInt);
}
{
h.C.staticInt = 1;
Expect.equals(0, --h.C?.staticInt);
Expect.equals(0, h.C.staticInt);
}
// The static type of --e1?.v is the same as the static type of e1.v - 1.
{
D? d = new D(new E()) as dynamic;
F? f = --d?.v;
Expect.identical(d!.v, f);
}
{
D.staticE = new E();
F? f = --D?.staticE;
Expect.identical(D.staticE, f);
}
{
h.D.staticE = new h.E();
h.F? f = --h.D?.staticE;
Expect.identical(h.D.staticE, f);
}
}

View file

@ -1,65 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it is used to invoke a method.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
f(callback()?) => callback!();
int g(int callback()) => callback();
static staticF(callback()) => callback();
static int staticG(int callback()) => callback();
}
C? nullC() => null;
main() {
// Make sure the "none" test fails if method invocation using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.f(null);
// o?.m(...) is equivalent to ((x) => x == null ? null : x.m(...))(o).
Expect.equals(null, nullC()?.f(bad()));
// C?.m(...) is equivalent to C.m(...).
// The static type of o?.m(...) is the same as the static type of
// o.m(...).
// Let T be the static type of o and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.m(...) are also
// generated in the case of o?.m(...).
// '?.' can't be used to access toplevel functions in libraries imported via
// prefix.
// Nor can it be used to access the toString method on the class Type.
}

View file

@ -1,66 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it is used to invoke a method.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
f(callback()?) => callback!();
int g(int callback()) => callback();
static staticF(callback()) => callback();
static int staticG(int callback()) => callback();
}
C? nullC() => null;
main() {
// Make sure the "none" test fails if method invocation using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.f(null);
// o?.m(...) is equivalent to ((x) => x == null ? null : x.m(...))(o).
var c = C() as C?;
Expect.equals(1, c?.f(() => 1));
// C?.m(...) is equivalent to C.m(...).
// The static type of o?.m(...) is the same as the static type of
// o.m(...).
// Let T be the static type of o and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.m(...) are also
// generated in the case of o?.m(...).
// '?.' can't be used to access toplevel functions in libraries imported via
// prefix.
// Nor can it be used to access the toString method on the class Type.
}

View file

@ -1,65 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it is used to invoke a method.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
f(callback()?) => callback!();
int g(int callback()) => callback();
static staticF(callback()) => callback();
static int staticG(int callback()) => callback();
}
C? nullC() => null;
main() {
// Make sure the "none" test fails if method invocation using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.f(null);
// o?.m(...) is equivalent to ((x) => x == null ? null : x.m(...))(o).
// C?.m(...) is equivalent to C.m(...).
Expect.equals(1, C?.staticF(() => 1));
// The static type of o?.m(...) is the same as the static type of
// o.m(...).
// Let T be the static type of o and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.m(...) are also
// generated in the case of o?.m(...).
// '?.' can't be used to access toplevel functions in libraries imported via
// prefix.
// Nor can it be used to access the toString method on the class Type.
}

View file

@ -1,65 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it is used to invoke a method.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
f(callback()?) => callback!();
int g(int callback()) => callback();
static staticF(callback()) => callback();
static int staticG(int callback()) => callback();
}
C? nullC() => null;
main() {
// Make sure the "none" test fails if method invocation using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.f(null);
// o?.m(...) is equivalent to ((x) => x == null ? null : x.m(...))(o).
// C?.m(...) is equivalent to C.m(...).
Expect.equals(1, h.C?.staticF(() => 1));
// The static type of o?.m(...) is the same as the static type of
// o.m(...).
// Let T be the static type of o and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.m(...) are also
// generated in the case of o?.m(...).
// '?.' can't be used to access toplevel functions in libraries imported via
// prefix.
// Nor can it be used to access the toString method on the class Type.
}

View file

@ -1,65 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it is used to invoke a method.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
f(callback()?) => callback!();
int g(int callback()) => callback();
static staticF(callback()) => callback();
static int staticG(int callback()) => callback();
}
C? nullC() => null;
main() {
// Make sure the "none" test fails if method invocation using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.f(null);
// o?.m(...) is equivalent to ((x) => x == null ? null : x.m(...))(o).
// C?.m(...) is equivalent to C.m(...).
// The static type of o?.m(...) is the same as the static type of
// o.m(...).
{ int? i = nullC()?.g(bad()); Expect.equals(null, i); }
// Let T be the static type of o and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.m(...) are also
// generated in the case of o?.m(...).
// '?.' can't be used to access toplevel functions in libraries imported via
// prefix.
// Nor can it be used to access the toString method on the class Type.
}

View file

@ -1,66 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it is used to invoke a method.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
f(callback()?) => callback!();
int g(int callback()) => callback();
static staticF(callback()) => callback();
static int staticG(int callback()) => callback();
}
C? nullC() => null;
main() {
// Make sure the "none" test fails if method invocation using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.f(null);
// o?.m(...) is equivalent to ((x) => x == null ? null : x.m(...))(o).
// C?.m(...) is equivalent to C.m(...).
// The static type of o?.m(...) is the same as the static type of
// o.m(...).
var c = new C() as C?;
{ int? i = c?.g(() => 1); Expect.equals(1, i); }
// Let T be the static type of o and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.m(...) are also
// generated in the case of o?.m(...).
// '?.' can't be used to access toplevel functions in libraries imported via
// prefix.
// Nor can it be used to access the toString method on the class Type.
}

View file

@ -1,65 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it is used to invoke a method.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
f(callback()?) => callback!();
int g(int callback()) => callback();
static staticF(callback()) => callback();
static int staticG(int callback()) => callback();
}
C? nullC() => null;
main() {
// Make sure the "none" test fails if method invocation using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.f(null);
// o?.m(...) is equivalent to ((x) => x == null ? null : x.m(...))(o).
// C?.m(...) is equivalent to C.m(...).
// The static type of o?.m(...) is the same as the static type of
// o.m(...).
{ int? i = C?.staticG(() => 1); Expect.equals(1, i); }
// Let T be the static type of o and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.m(...) are also
// generated in the case of o?.m(...).
// '?.' can't be used to access toplevel functions in libraries imported via
// prefix.
// Nor can it be used to access the toString method on the class Type.
}

View file

@ -1,65 +0,0 @@
// TODO(multitest): This was automatically migrated from a multitest and may
// contain strange or dead code.
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Verify semantics of the ?. operator when it is used to invoke a method.
import "package:expect/expect.dart";
import "conditional_access_helper.dart" as h;
bad() {
Expect.fail('Should not be executed');
}
class B {}
class C extends B {
f(callback()?) => callback!();
int g(int callback()) => callback();
static staticF(callback()) => callback();
static int staticG(int callback()) => callback();
}
C? nullC() => null;
main() {
// Make sure the "none" test fails if method invocation using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.f(null);
// o?.m(...) is equivalent to ((x) => x == null ? null : x.m(...))(o).
// C?.m(...) is equivalent to C.m(...).
// The static type of o?.m(...) is the same as the static type of
// o.m(...).
{ int? i = h.C?.staticG(() => 1); Expect.equals(1, i); }
// Let T be the static type of o and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.m(...) are also
// generated in the case of o?.m(...).
// '?.' can't be used to access toplevel functions in libraries imported via
// prefix.
// Nor can it be used to access the toString method on the class Type.
}

View file

@ -26,40 +26,30 @@ class C extends B {
C? nullC() => null;
main() {
// Make sure the "none" test fails if method invocation using "?." is not
// implemented. This makes status files easier to maintain.
nullC()?.f(null);
// o?.m(...) is equivalent to ((x) => x == null ? null : x.m(...))(o).
Expect.equals(null, nullC()?.f(bad()));
C? c = C() as dynamic;
Expect.equals(1, c?.f(() => 1));
// C?.m(...) is equivalent to C.m(...).
Expect.equals(1, C?.staticF(() => 1));
Expect.equals(1, h.C?.staticF(() => 1));
// The static type of o?.m(...) is the same as the static type of
// o.m(...).
// Let T be the static type of o and let y be a fresh variable of type T.
// Exactly the same static warnings that would be caused by y.m(...) are also
// generated in the case of o?.m(...).
// '?.' can't be used to access toplevel functions in libraries imported via
// prefix.
// Nor can it be used to access the toString method on the class Type.
{
int? i = nullC()?.g(bad());
Expect.equals(null, i);
}
{
int? i = c?.g(() => 1);
Expect.equals(1, i);
}
{
int? i = C?.staticG(() => 1);
Expect.equals(1, i);
}
{
int? i = h.C?.staticG(() => 1);
Expect.equals(1, i);
}
}