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

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

Issue 12210142: Implement is-checks against type variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix a long line. 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 2489 matching lines...) Expand 10 before | Expand all | Expand 10 after
2500 world.registerInstantiatedClass( 2500 world.registerInstantiatedClass(
2501 constructor.getEnclosingClass().declaration); 2501 constructor.getEnclosingClass().declaration);
2502 constructor = constructor.defaultImplementation; 2502 constructor = constructor.defaultImplementation;
2503 } 2503 }
2504 // [constructor.defaultImplementation] might be the implementation element 2504 // [constructor.defaultImplementation] might be the implementation element
2505 // and only declaration elements may be registered. 2505 // and only declaration elements may be registered.
2506 world.registerStaticUse(constructor.declaration); 2506 world.registerStaticUse(constructor.declaration);
2507 ClassElement cls = constructor.getEnclosingClass(); 2507 ClassElement cls = constructor.getEnclosingClass();
2508 // [cls] might be the implementation element and only declaration elements 2508 // [cls] might be the implementation element and only declaration elements
2509 // may be registered. 2509 // may be registered.
2510 world.registerInstantiatedClass(cls.declaration); 2510 world.registerInstantiatedType(mapping.getType(node));
2511 if (cls.isAbstract(compiler)) { 2511 if (cls.isAbstract(compiler)) {
2512 compiler.backend.registerAbstractClassInstantiation(); 2512 compiler.backend.registerAbstractClassInstantiation();
2513 } 2513 }
2514 // [cls] might be the declaration element and we want to include injected 2514 // [cls] might be the declaration element and we want to include injected
2515 // members. 2515 // members.
2516 cls.implementation.forEachInstanceField( 2516 cls.implementation.forEachInstanceField(
2517 (ClassElement enclosingClass, Element member) { 2517 (ClassElement enclosingClass, Element member) {
2518 world.addToWorkList(member); 2518 world.addToWorkList(member);
2519 }, 2519 },
2520 includeBackendMembers: false, 2520 includeBackendMembers: false,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
2570 if (inCheckContext) { 2570 if (inCheckContext) {
2571 compiler.enqueuer.resolution.registerIsCheck(type); 2571 compiler.enqueuer.resolution.registerIsCheck(type);
2572 } 2572 }
2573 if (typeRequired || inCheckContext) { 2573 if (typeRequired || inCheckContext) {
2574 if (type is InterfaceType) { 2574 if (type is InterfaceType) {
2575 InterfaceType itf = type; 2575 InterfaceType itf = type;
2576 itf.typeArguments.forEach((DartType argument) { 2576 itf.typeArguments.forEach((DartType argument) {
2577 analyzeTypeArgument(type, argument); 2577 analyzeTypeArgument(type, argument);
2578 }); 2578 });
2579 } 2579 }
2580 // TODO(ngeoffray): Also handle cases like: 2580 // TODO(ngeoffray): Also handle T a (in checked mode).
2581 // 1) a is T
2582 // 2) T a (in checked mode).
2583 } 2581 }
2584 return type; 2582 return type;
2585 } 2583 }
2586 2584
2587 visitModifiers(Modifiers node) { 2585 visitModifiers(Modifiers node) {
2588 // TODO(ngeoffray): Implement this. 2586 // TODO(ngeoffray): Implement this.
2589 unimplemented(node, 'modifiers'); 2587 unimplemented(node, 'modifiers');
2590 } 2588 }
2591 2589
2592 visitLiteralList(LiteralList node) { 2590 visitLiteralList(LiteralList node) {
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after
3803 return e; 3801 return e;
3804 } 3802 }
3805 3803
3806 /// Assumed to be called by [resolveRedirectingFactory]. 3804 /// Assumed to be called by [resolveRedirectingFactory].
3807 Element visitReturn(Return node) { 3805 Element visitReturn(Return node) {
3808 Node expression = node.expression; 3806 Node expression = node.expression;
3809 return finishConstructorReference(visit(expression), 3807 return finishConstructorReference(visit(expression),
3810 expression, expression); 3808 expression, expression);
3811 } 3809 }
3812 } 3810 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698