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

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

Issue 1469353008: dart2js: Type inferrence: Account for implicit null test in '??' and '??='. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
Index: pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
diff --git a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
index 4a03bafed62e2f1b15f56ab4ae039827043fb166..dded10cf912cfde83b588831ba2dcb5e783042ea 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
@@ -337,6 +337,16 @@ class TypeInformationSystem extends TypeSystem<TypeInformation> {
}
}
+ TypeInformation narrowNotNull(TypeInformation type) {
+ if (type.type.isExact && !type.type.isNullable) {
+ return type;
+ }
+ TypeInformation newType =
+ new NarrowTypeInformation(type, dynamicType.type.nonNullable());
Siggi Cherem (dart-lang) 2015/11/26 02:21:48 would it be incorrect here to use type.type.nonNul
sra1 2015/12/01 02:14:10 I'm not sure what type.type holds at this point fo
+ allocatedTypes.add(newType);
+ return newType;
+ }
+
ElementTypeInformation getInferredTypeOf(Element element) {
element = element.implementation;
return typeInformations.putIfAbsent(element, () {

Powered by Google App Engine
This is Rietveld 408576698