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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/inferrer/inferrer_visitor.dart

Issue 359413006: Fix handling of type literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Split visitTypeReferenceSend Created 6 years, 5 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library inferrer_visitor; 5 library inferrer_visitor;
6 6
7 import '../dart2jslib.dart' hide Selector, TypedSelector; 7 import '../dart2jslib.dart' hide Selector, TypedSelector;
8 import '../dart_types.dart'; 8 import '../dart_types.dart';
9 import '../elements/elements.dart'; 9 import '../elements/elements.dart';
10 import '../tree/tree.dart'; 10 import '../tree/tree.dart';
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 return types.nullType; 733 return types.nullType;
734 } 734 }
735 735
736 T visitLiteralSymbol(LiteralSymbol node) { 736 T visitLiteralSymbol(LiteralSymbol node) {
737 // TODO(kasperl): We should be able to tell that the type of a literal 737 // TODO(kasperl): We should be able to tell that the type of a literal
738 // symbol is always a non-null exact symbol implementation -- not just 738 // symbol is always a non-null exact symbol implementation -- not just
739 // any non-null subtype of the symbol interface. 739 // any non-null subtype of the symbol interface.
740 return types.nonNullSubtype(compiler.symbolClass); 740 return types.nonNullSubtype(compiler.symbolClass);
741 } 741 }
742 742
743 T visitTypeReferenceSend(Send node) { 743 T visitTypePrefixSend(Send node) {
744 return elements.isTypeLiteral(node) ? types.typeType : types.dynamicType; 744 // TODO(johnniwinther): Remove the need for handling this node.
745 return types.dynamicType;
746 }
747
748 T visitTypeLiteralSend(Send node) {
749 return types.typeType;
745 } 750 }
746 751
747 bool isThisOrSuper(Node node) => node.isThis() || node.isSuper(); 752 bool isThisOrSuper(Node node) => node.isThis() || node.isSuper();
748 753
749 Element get outermostElement { 754 Element get outermostElement {
750 return analyzedElement.outermostEnclosingMemberOrTopLevel.implementation; 755 return analyzedElement.outermostEnclosingMemberOrTopLevel.implementation;
751 } 756 }
752 757
753 T _thisType; 758 T _thisType;
754 T get thisType { 759 T get thisType {
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 return type; 1223 return type;
1219 } 1224 }
1220 1225
1221 T visitCascade(Cascade node) { 1226 T visitCascade(Cascade node) {
1222 // Ignore the result of the cascade send and return the type of the cascade 1227 // Ignore the result of the cascade send and return the type of the cascade
1223 // receiver. 1228 // receiver.
1224 visit(node.expression); 1229 visit(node.expression);
1225 return cascadeReceiverStack.removeLast(); 1230 return cascadeReceiverStack.removeLast();
1226 } 1231 }
1227 } 1232 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698