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

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

Issue 1238783003: Handle deferred access as pre-step in SemanticSendVisitor. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 5 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/resolution/resolution_result.dart
diff --git a/pkg/compiler/lib/src/resolution/resolution_result.dart b/pkg/compiler/lib/src/resolution/resolution_result.dart
index ba2b74cdd58c5eb91f5034e791bcf2787ef7e485..4b12234016736a1f1fc0305a374c59ecd87b3fa4 100644
--- a/pkg/compiler/lib/src/resolution/resolution_result.dart
+++ b/pkg/compiler/lib/src/resolution/resolution_result.dart
@@ -10,6 +10,7 @@ enum ResultKind {
TYPE,
ASSERT,
CONSTANT,
+ PREFIX,
}
/// The result of resolving a node.
@@ -30,13 +31,32 @@ abstract class ResolutionResult {
bool get isConstant => false;
}
+/// The prefix of top level or member access, like `prefix.member`,
+/// `prefix.Class.member` or `Class.member`.
+class PrefixResult extends ResolutionResult {
+ final PrefixElement prefix;
+ final ClassElement cls;
+
+ PrefixResult(this.prefix, this.cls);
+
+ Element get element => cls != null ? cls : prefix;
+
+ bool get isDeferred => prefix != null && prefix.isDeferred;
+
+ ResultKind get kind => ResultKind.PREFIX;
+
+ String toString() => 'PrefixResult($prefix,$cls)';
+}
+
/// The result for the resolution of a node that points to an [Element].
class ElementResult extends ResolutionResult {
final Element element;
ResultKind get kind => ResultKind.ELEMENT;
- ElementResult(this.element);
+ ElementResult(this.element) {
+ assert(element != null);
+ }
String toString() => 'ElementResult($element)';
}
« no previous file with comments | « pkg/compiler/lib/src/resolution/registry.dart ('k') | pkg/compiler/lib/src/resolution/semantic_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698