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

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

Issue 2033383002: Handle use of fromEnvironment from serialized data. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes Created 4 years, 6 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
Index: pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
diff --git a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
index 2bc367096676516be426167c5ad822175ff8150a..ea9e8936c93e46883fcfed13a49ae9505fbab361 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
@@ -494,15 +494,18 @@ class MemberTypeInformation extends ElementTypeInformation
}
Compiler compiler = inferrer.compiler;
- if (element.declaration == compiler.intEnvironment) {
- giveUp(inferrer);
- return compiler.typesTask.intType.nullable();
- } else if (element.declaration == compiler.boolEnvironment) {
- giveUp(inferrer);
- return compiler.typesTask.boolType.nullable();
- } else if (element.declaration == compiler.stringEnvironment) {
- giveUp(inferrer);
- return compiler.typesTask.stringType.nullable();
+ if (element.isConstructor) {
+ ConstructorElement constructor = element;
+ if (constructor.isIntFromEnvironmentConstructor) {
+ giveUp(inferrer);
+ return compiler.typesTask.intType.nullable();
+ } else if (constructor.isBoolFromEnvironmentConstructor) {
+ giveUp(inferrer);
+ return compiler.typesTask.boolType.nullable();
+ } else if (constructor.isStringFromEnvironmentConstructor) {
+ giveUp(inferrer);
+ return compiler.typesTask.stringType.nullable();
+ }
}
return null;
}

Powered by Google App Engine
This is Rietveld 408576698