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

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: Update illegal_invocation_test and status. 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 get currentElement; 8 Element get currentElement;
9 Set<Node> get superUses; 9 Set<Node> get superUses;
10 10
(...skipping 2180 matching lines...) Expand 10 before | Expand all | Expand 10 after
2191 if (!Elements.isUnresolved(target)) { 2191 if (!Elements.isUnresolved(target)) {
2192 if (target.isAbstractField()) { 2192 if (target.isAbstractField()) {
2193 AbstractFieldElement field = target; 2193 AbstractFieldElement field = target;
2194 target = field.getter; 2194 target = field.getter;
2195 if (target == null && !inInstanceContext) { 2195 if (target == null && !inInstanceContext) {
2196 compiler.backend.registerThrowNoSuchMethod(mapping); 2196 compiler.backend.registerThrowNoSuchMethod(mapping);
2197 target = 2197 target =
2198 warnAndCreateErroneousElement(node.selector, field.name, 2198 warnAndCreateErroneousElement(node.selector, field.name,
2199 MessageKind.CANNOT_RESOLVE_GETTER); 2199 MessageKind.CANNOT_RESOLVE_GETTER);
2200 } 2200 }
2201 } else if (target.isTypeVariable()) {
2202 ClassElement cls = target.getEnclosingClass();
2203 assert(enclosingElement.getEnclosingClass() == cls);
2204 compiler.world.registerClassUsingVariableExpression(cls);
2205 compiler.backend.registerTypeVariableExpression(mapping);
2201 } else if (target.impliesType() && !sendIsMemberAccess) { 2206 } else if (target.impliesType() && !sendIsMemberAccess) {
2202 compiler.backend.registerTypeLiteral(mapping); 2207 compiler.backend.registerTypeLiteral(mapping);
2203 } 2208 }
2204 } 2209 }
2205 2210
2206 bool resolvedArguments = false; 2211 bool resolvedArguments = false;
2207 if (node.isOperator) { 2212 if (node.isOperator) {
2208 String operatorString = node.selector.asOperator().source.stringValue; 2213 String operatorString = node.selector.asOperator().source.stringValue;
2209 if (operatorString == 'is' || operatorString == 'as') { 2214 if (operatorString == 'is' || operatorString == 'as') {
2210 assert(node.arguments.tail.isEmpty); 2215 assert(node.arguments.tail.isEmpty);
(...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after
3842 return e; 3847 return e;
3843 } 3848 }
3844 3849
3845 /// Assumed to be called by [resolveRedirectingFactory]. 3850 /// Assumed to be called by [resolveRedirectingFactory].
3846 Element visitReturn(Return node) { 3851 Element visitReturn(Return node) {
3847 Node expression = node.expression; 3852 Node expression = node.expression;
3848 return finishConstructorReference(visit(expression), 3853 return finishConstructorReference(visit(expression),
3849 expression, expression); 3854 expression, expression);
3850 } 3855 }
3851 } 3856 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698