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

Unified Diff: pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart

Issue 1966763003: Fix inference reference to .initializer (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/compiler/dart2js/serialization/compilation_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
diff --git a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
index bcc96c8b113984b22af0de74f7bdcdc1b12429b0..307857286ca4c930a02cee95839521a828580d82 100644
--- a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
@@ -667,16 +667,17 @@ class SimpleTypeInferrerVisitor<T>
if (isThisExposed) return;
inferrer.forEachElementMatching(selector, mask, (element) {
if (element.isField) {
+ ResolvedAst elementResolvedAst = getResolvedAst(element);
if (!selector.isSetter &&
isInClassOrSubclass(element) &&
!element.isFinal &&
locals.fieldScope.readField(element) == null &&
- element.initializer == null) {
+ elementResolvedAst.body == null) {
// If the field is being used before this constructor
// actually had a chance to initialize it, say it can be
// null.
inferrer.recordTypeOfNonFinalField(
- analyzedElement.node, element, types.nullType);
+ resolvedAst.node, element, types.nullType);
}
// Accessing a field does not expose [:this:].
return true;
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/compilation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698