Version 2.15.0-194.0.dev
Merge commit 'ca9e1e98013fcad585690b4101d59fe7f0116a31' into 'dev'
diff --git a/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart b/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
index a9c9d65..e85dce6 100644
--- a/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
@@ -4740,11 +4740,11 @@
String get targetName => '';
@override
- Expression buildSimpleRead() => expression;
+ Expression buildSimpleRead() => _createRead();
@override
Expression _createRead() =>
- _helper.forest.createParenthesized(fileOffset, expression);
+ _helper.forest.createParenthesized(expression.fileOffset, expression);
@override
String get _debugName => "ParenthesizedExpressionGenerator";
diff --git a/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart b/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
index 91cd4ff..4e18e23 100644
--- a/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
@@ -1433,7 +1433,7 @@
node.left, inferrer.computeNullable(typeContext), true,
isVoidAllowed: false);
reportNonNullableInNullAwareWarningIfNeeded(
- lhsResult.inferredType, "??", node.left.fileOffset);
+ lhsResult.inferredType, "??", lhsResult.expression.fileOffset);
// This ends any shorting in `node.left`.
Expression left = lhsResult.expression;
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index e11a372..3fcba19 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -586,7 +586,6 @@
contextType,
errorTemplate.withArguments(expressionType,
declaredContextType ?? contextType, isNonNullableByDefault));
-
break;
case AssignabilityKind.unassignableVoid:
// Error: not assignable. Perform error recovery.
diff --git a/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart b/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart
new file mode 100644
index 0000000..6a7228b
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart
@@ -0,0 +1,15 @@
+// Copyright (c) 2021, 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.
+
+class A {
+ int get foo => throw 42;
+}
+
+bar(int x) {}
+
+test(A? a) {
+ bar((a?.foo)!);
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.strong.expect b/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.strong.expect
new file mode 100644
index 0000000..bb556eb
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.strong.expect
@@ -0,0 +1,16 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ synthetic constructor •() → self::A
+ : super core::Object::•()
+ ;
+ get foo() → core::int
+ return throw 42;
+}
+static method bar(core::int x) → dynamic {}
+static method test(self::A? a) → dynamic {
+ self::bar((let final self::A? #t1 = a in #t1 == null ?{core::int?} null : #t1{self::A}.{self::A::foo}{core::int})!);
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.strong.transformed.expect b/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.strong.transformed.expect
new file mode 100644
index 0000000..bb556eb
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.strong.transformed.expect
@@ -0,0 +1,16 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ synthetic constructor •() → self::A
+ : super core::Object::•()
+ ;
+ get foo() → core::int
+ return throw 42;
+}
+static method bar(core::int x) → dynamic {}
+static method test(self::A? a) → dynamic {
+ self::bar((let final self::A? #t1 = a in #t1 == null ?{core::int?} null : #t1{self::A}.{self::A::foo}{core::int})!);
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.textual_outline.expect
new file mode 100644
index 0000000..e36ef60
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.textual_outline.expect
@@ -0,0 +1,7 @@
+class A {
+ int get foo => throw 42;
+}
+
+bar(int x) {}
+test(A? a) {}
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..755c4d8
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.textual_outline_modelled.expect
@@ -0,0 +1,8 @@
+bar(int x) {}
+
+class A {
+ int get foo => throw 42;
+}
+
+main() {}
+test(A? a) {}
diff --git a/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.weak.expect b/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.weak.expect
new file mode 100644
index 0000000..bb556eb
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.weak.expect
@@ -0,0 +1,16 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ synthetic constructor •() → self::A
+ : super core::Object::•()
+ ;
+ get foo() → core::int
+ return throw 42;
+}
+static method bar(core::int x) → dynamic {}
+static method test(self::A? a) → dynamic {
+ self::bar((let final self::A? #t1 = a in #t1 == null ?{core::int?} null : #t1{self::A}.{self::A::foo}{core::int})!);
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.weak.outline.expect b/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.weak.outline.expect
new file mode 100644
index 0000000..0fa1c0c
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.weak.outline.expect
@@ -0,0 +1,16 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ synthetic constructor •() → self::A
+ ;
+ get foo() → core::int
+ ;
+}
+static method bar(core::int x) → dynamic
+ ;
+static method test(self::A? a) → dynamic
+ ;
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.weak.transformed.expect b/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.weak.transformed.expect
new file mode 100644
index 0000000..bb556eb
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/parenthesized_stop_shorting.dart.weak.transformed.expect
@@ -0,0 +1,16 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ synthetic constructor •() → self::A
+ : super core::Object::•()
+ ;
+ get foo() → core::int
+ return throw 42;
+}
+static method bar(core::int x) → dynamic {}
+static method test(self::A? a) → dynamic {
+ self::bar((let final self::A? #t1 = a in #t1 == null ?{core::int?} null : #t1{self::A}.{self::A::foo}{core::int})!);
+}
+static method main() → dynamic {}
diff --git a/tools/VERSION b/tools/VERSION
index b02aebf..b897739 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 15
PATCH 0
-PRERELEASE 193
+PRERELEASE 194
PRERELEASE_PATCH 0
\ No newline at end of file