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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 12598003: Support type variables as expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of resolution; 5 part of resolution;
6 6
7 abstract class TreeElements { 7 abstract class TreeElements {
8 Element operator[](Node node); 8 Element operator[](Node node);
9 Selector getSelector(Send send); 9 Selector getSelector(Send send);
10 Selector getGetterSelectorInComplexSendSet(SendSet node); 10 Selector getGetterSelectorInComplexSendSet(SendSet node);
(...skipping 2164 matching lines...) Expand 10 before | Expand all | Expand 10 after
2175 if (!Elements.isUnresolved(target)) { 2175 if (!Elements.isUnresolved(target)) {
2176 if (target.isAbstractField()) { 2176 if (target.isAbstractField()) {
2177 AbstractFieldElement field = target; 2177 AbstractFieldElement field = target;
2178 target = field.getter; 2178 target = field.getter;
2179 if (target == null && !inInstanceContext) { 2179 if (target == null && !inInstanceContext) {
2180 compiler.backend.registerThrowNoSuchMethod(); 2180 compiler.backend.registerThrowNoSuchMethod();
2181 target = 2181 target =
2182 warnAndCreateErroneousElement(node.selector, field.name, 2182 warnAndCreateErroneousElement(node.selector, field.name,
2183 MessageKind.CANNOT_RESOLVE_GETTER); 2183 MessageKind.CANNOT_RESOLVE_GETTER);
2184 } 2184 }
2185 } else if (target.isTypeVariable()) {
2186 ClassElement cls = target.getEnclosingClass();
ngeoffray 2013/03/11 10:24:06 assert that cls is also the enclosing class of the
karlklose 2013/03/12 09:05:02 Done.
2187 compiler.world.classesUsingVariableExpression.add(cls);
ngeoffray 2013/03/11 10:24:06 classesUsingTypeVariableExpression.
ahe 2013/03/11 13:11:24 Could you please make an abstraction rather than a
karlklose 2013/03/12 09:05:02 Done, good point.
karlklose 2013/03/12 09:05:02 Done.
2188 compiler.backend.registerTypeVariable();
2185 } else if (target.impliesType() && !sendIsMemberAccess) { 2189 } else if (target.impliesType() && !sendIsMemberAccess) {
2186 compiler.backend.registerTypeLiteral(); 2190 compiler.backend.registerTypeLiteral();
2187 } 2191 }
2188 } 2192 }
2189 2193
2190 bool resolvedArguments = false; 2194 bool resolvedArguments = false;
2191 if (node.isOperator) { 2195 if (node.isOperator) {
2192 String operatorString = node.selector.asOperator().source.stringValue; 2196 String operatorString = node.selector.asOperator().source.stringValue;
2193 if (operatorString == 'is' || operatorString == 'as') { 2197 if (operatorString == 'is' || operatorString == 'as') {
2194 assert(node.arguments.tail.isEmpty); 2198 assert(node.arguments.tail.isEmpty);
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after
3825 return e; 3829 return e;
3826 } 3830 }
3827 3831
3828 /// Assumed to be called by [resolveRedirectingFactory]. 3832 /// Assumed to be called by [resolveRedirectingFactory].
3829 Element visitReturn(Return node) { 3833 Element visitReturn(Return node) {
3830 Node expression = node.expression; 3834 Node expression = node.expression;
3831 return finishConstructorReference(visit(expression), 3835 return finishConstructorReference(visit(expression),
3832 expression, expression); 3836 expression, expression);
3833 } 3837 }
3834 } 3838 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698