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

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

Issue 1149973004: Start to compute SendStructure in resolution. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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 | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/send_resolver.dart
diff --git a/pkg/compiler/lib/src/resolution/send_resolver.dart b/pkg/compiler/lib/src/resolution/send_resolver.dart
index 77e35827ceb1f87252eb1e1ca789da3b51221940..11282745df498d20b00dc436c3d755341fd43170 100644
--- a/pkg/compiler/lib/src/resolution/send_resolver.dart
+++ b/pkg/compiler/lib/src/resolution/send_resolver.dart
@@ -196,7 +196,13 @@ abstract class SendResolverMixin {
}
SendStructure computeSendStructure(Send node) {
+ SendStructure sendStructure = elements.getSendStructure(node);
+ if (sendStructure != null) {
+ return sendStructure;
+ }
+
if (elements.isAssert(node)) {
+ assert(invariant(node, false, message: "Unexpected assert."));
karlklose 2015/05/22 10:08:36 Shouldn't we always throw instead of creating stru
Johnni Winther 2015/05/22 12:24:58 Done.
if (!node.arguments.isEmpty && node.arguments.tail.isEmpty) {
return const AssertStructure();
} else {
@@ -212,6 +218,7 @@ abstract class SendResolverMixin {
if (node.isOperator) {
String operatorText = node.selector.asOperator().source;
if (operatorText == 'is') {
+ assert(invariant(node, false, message: "Unexpected is test."));
if (node.isIsNotCheck) {
return new IsNotStructure(
elements.getType(node.arguments.single.asSend().receiver));
@@ -219,10 +226,13 @@ abstract class SendResolverMixin {
return new IsStructure(elements.getType(node.arguments.single));
}
} else if (operatorText == 'as') {
+ assert(invariant(node, false, message: "Unexpected as cast."));
return new AsStructure(elements.getType(node.arguments.single));
} else if (operatorText == '&&') {
+ assert(invariant(node, false, message: "Unexpected logical and."));
return const LogicalAndStructure();
} else if (operatorText == '||') {
+ assert(invariant(node, false, message: "Unexpected logical or."));
return const LogicalOrStructure();
}
}
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698