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

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

Issue 1120633002: Refactor index operator in SimpleTypeInferrer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments 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
Index: pkg/compiler/lib/src/resolution/send_structure.dart
diff --git a/pkg/compiler/lib/src/resolution/send_structure.dart b/pkg/compiler/lib/src/resolution/send_structure.dart
index 475451f23fa7a9a8a52ac5e9134899b2442e7443..c34a6a6ec2ea38bf755931b6e7caaaf994971487 100644
--- a/pkg/compiler/lib/src/resolution/send_structure.dart
+++ b/pkg/compiler/lib/src/resolution/send_structure.dart
@@ -1019,8 +1019,7 @@ class IndexSetStructure<R, A> implements SendStructure<R, A> {
arg);
case AccessKind.UNRESOLVED_SUPER:
case AccessKind.UNRESOLVED:
- // TODO(johnniwinther): Support these through [AccessKind.COMPOUND].
- return visitor.errorUnresolvedSuperIndexSet(
+ return visitor.visitUnresolvedSuperIndexSet(
node,
semantics.element,
node.arguments.first,
@@ -1068,15 +1067,6 @@ class IndexPrefixStructure<R, A> implements SendStructure<R, A> {
node.arguments.single,
operator,
arg);
- case AccessKind.UNRESOLVED_SUPER:
- case AccessKind.UNRESOLVED:
- // TODO(johnniwinther): Support these through [AccessKind.COMPOUND].
- return visitor.errorUnresolvedSuperIndexPrefix(
- node,
- semantics.element,
- node.arguments.single,
- operator,
- arg);
case AccessKind.COMPOUND:
CompoundAccessSemantics compoundSemantics = semantics;
switch (compoundSemantics.compoundAccessKind) {
@@ -1088,6 +1078,21 @@ class IndexPrefixStructure<R, A> implements SendStructure<R, A> {
node.arguments.single,
operator,
arg);
+ case CompoundAccessKind.UNRESOLVED_SUPER_GETTER:
+ return visitor.visitUnresolvedSuperGetterIndexPrefix(
+ node,
+ compoundSemantics.getter,
+ node.arguments.single,
+ operator,
+ arg);
+ case CompoundAccessKind.UNRESOLVED_SUPER_SETTER:
+ return visitor.visitUnresolvedSuperSetterIndexPrefix(
+ node,
+ compoundSemantics.getter,
+ compoundSemantics.setter,
+ node.arguments.single,
+ operator,
+ arg);
default:
// This is not a valid case.
break;
@@ -1133,15 +1138,6 @@ class IndexPostfixStructure<R, A> implements SendStructure<R, A> {
node.arguments.single,
operator,
arg);
- case AccessKind.UNRESOLVED_SUPER:
- case AccessKind.UNRESOLVED:
- // TODO(johnniwinther): Support these through [AccessKind.COMPOUND].
- return visitor.errorUnresolvedSuperIndexPostfix(
- node,
- semantics.element,
- node.arguments.single,
- operator,
- arg);
case AccessKind.COMPOUND:
CompoundAccessSemantics compoundSemantics = semantics;
switch (compoundSemantics.compoundAccessKind) {
@@ -1153,6 +1149,21 @@ class IndexPostfixStructure<R, A> implements SendStructure<R, A> {
node.arguments.single,
operator,
arg);
+ case CompoundAccessKind.UNRESOLVED_SUPER_GETTER:
+ return visitor.visitUnresolvedSuperGetterIndexPostfix(
+ node,
+ compoundSemantics.getter,
+ node.arguments.single,
+ operator,
+ arg);
+ case CompoundAccessKind.UNRESOLVED_SUPER_SETTER:
+ return visitor.visitUnresolvedSuperSetterIndexPostfix(
+ node,
+ compoundSemantics.getter,
+ compoundSemantics.setter,
+ node.arguments.single,
+ operator,
+ arg);
default:
// This is not a valid case.
break;
@@ -1391,6 +1402,16 @@ class CompoundStructure<R, A> implements SendStructure<R, A> {
operator,
node.arguments.single,
arg);
+ case CompoundAccessKind.UNRESOLVED_SUPER_GETTER:
+ case CompoundAccessKind.UNRESOLVED_SUPER_SETTER:
+ // TODO(johnniwinther): Handle these separately.
+ return visitor.errorUnresolvedCompound(
+ node,
+ semantics.element,
+ operator,
+ node.arguments.single,
+ arg);
+ break;
}
break;
}
@@ -1430,16 +1451,6 @@ class CompoundIndexSetStructure<R, A> implements SendStructure<R, A> {
operator,
node.arguments.tail.head,
arg);
- case AccessKind.UNRESOLVED_SUPER:
- case AccessKind.UNRESOLVED:
- // TODO(johnniwinther): Support these through [AccessKind.COMPOUND].
- return visitor.errorUnresolvedSuperCompoundIndexSet(
- node,
- semantics.element,
- node.arguments.first,
- operator,
- node.arguments.tail.head,
- arg);
case AccessKind.COMPOUND:
CompoundAccessSemantics compoundSemantics = semantics;
switch (compoundSemantics.compoundAccessKind) {
@@ -1452,6 +1463,23 @@ class CompoundIndexSetStructure<R, A> implements SendStructure<R, A> {
operator,
node.arguments.tail.head,
arg);
+ case CompoundAccessKind.UNRESOLVED_SUPER_GETTER:
+ return visitor.visitUnresolvedSuperGetterCompoundIndexSet(
+ node,
+ compoundSemantics.getter,
+ node.arguments.first,
+ operator,
+ node.arguments.tail.head,
+ arg);
+ case CompoundAccessKind.UNRESOLVED_SUPER_SETTER:
+ return visitor.visitUnresolvedSuperSetterCompoundIndexSet(
+ node,
+ compoundSemantics.getter,
+ compoundSemantics.setter,
+ node.arguments.first,
+ operator,
+ node.arguments.tail.head,
+ arg);
default:
// This is not a valid case.
break;
@@ -1675,6 +1703,14 @@ class PrefixStructure<R, A> implements SendStructure<R, A> {
compoundSemantics.setter,
operator,
arg);
+ case CompoundAccessKind.UNRESOLVED_SUPER_GETTER:
+ case CompoundAccessKind.UNRESOLVED_SUPER_SETTER:
+ // TODO(johnniwinther): Handle these directly.
+ return visitor.errorUnresolvedPrefix(
+ node,
+ semantics.element,
+ operator,
+ arg);
}
}
throw new SpannableAssertionFailure(node,
@@ -1891,6 +1927,14 @@ class PostfixStructure<R, A> implements SendStructure<R, A> {
compoundSemantics.setter,
operator,
arg);
+ case CompoundAccessKind.UNRESOLVED_SUPER_GETTER:
+ case CompoundAccessKind.UNRESOLVED_SUPER_SETTER:
+ // TODO(johnniwinther): Handle these directly.
+ return visitor.errorUnresolvedPostfix(
+ node,
+ semantics.element,
+ operator,
+ arg);
}
}
throw new SpannableAssertionFailure(node,
« no previous file with comments | « pkg/compiler/lib/src/resolution/send_resolver.dart ('k') | tests/compiler/dart2js/semantic_visitor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698