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

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

Issue 1939703002: Don't crash on deserialized type inference. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments + minor fix. Created 4 years, 8 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 | « pkg/compiler/lib/src/common/resolution.dart ('k') | pkg/compiler/lib/src/inferrer/inferrer_visitor.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 2eebdb39db1c68af188fc47500a0e01c6976987e..4aa08fdf8e94844ab8523ea7cfdd9b00b431359f 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -1918,27 +1918,25 @@ class _CompilerResolution implements Resolution {
}
@override
- bool hasResolvedAst(Element element) {
+ bool hasResolvedAst(ExecutableElement element) {
assert(invariant(element, element.isDeclaration,
message: "Element $element must be the declaration."));
if (compiler.serialization.isDeserialized(element)) {
return compiler.serialization.hasResolvedAst(element);
}
- return element is AstElement &&
- hasBeenResolved(element) &&
+ return hasBeenResolved(element.memberContext.declaration) &&
element.hasResolvedAst;
}
@override
- ResolvedAst getResolvedAst(Element element) {
+ ResolvedAst getResolvedAst(ExecutableElement element) {
assert(invariant(element, element.isDeclaration,
message: "Element $element must be the declaration."));
if (hasResolvedAst(element)) {
if (compiler.serialization.isDeserialized(element)) {
return compiler.serialization.getResolvedAst(element);
}
- AstElement astElement = element;
- return astElement.resolvedAst;
+ return element.resolvedAst;
}
assert(invariant(element, hasResolvedAst(element),
message: "ResolvedAst not available for $element."));
« no previous file with comments | « pkg/compiler/lib/src/common/resolution.dart ('k') | pkg/compiler/lib/src/inferrer/inferrer_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698