Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart

Issue 2996523003: Fix incorrect nullability inference for ?? (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/language_strong/nullaware_opt_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart b/pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart
index 45330349f4329dbccb85904126868b4a34b9a5fd..d6a7f07842a086387805124d90c5937a6f3e622d 100644
--- a/pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart
+++ b/pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart
@@ -59,7 +59,8 @@ abstract class NullableTypeInference {
// resulting value if that becomes an issue, so we maintain the invariant
// that each node is visited once.
Element element = null;
- if (expr is PropertyAccess) {
+ if (expr is PropertyAccess &&
+ expr.operator?.type != TokenType.QUESTION_PERIOD) {
element = expr.propertyName.staticElement;
} else if (expr is Identifier) {
element = expr.staticElement;
« no previous file with comments | « no previous file | tests/language_strong/nullaware_opt_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698