OLD | NEW |
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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 } | 685 } |
686 | 686 |
687 T visitLiteralSymbol(LiteralSymbol node) { | 687 T visitLiteralSymbol(LiteralSymbol node) { |
688 // TODO(kasperl): We should be able to tell that the type of a literal | 688 // TODO(kasperl): We should be able to tell that the type of a literal |
689 // symbol is always a non-null exact symbol implementation -- not just | 689 // symbol is always a non-null exact symbol implementation -- not just |
690 // any non-null subtype of the symbol interface. | 690 // any non-null subtype of the symbol interface. |
691 return types.nonNullSubtype(compiler.symbolClass); | 691 return types.nonNullSubtype(compiler.symbolClass); |
692 } | 692 } |
693 | 693 |
694 T visitTypeReferenceSend(Send node) { | 694 T visitTypeReferenceSend(Send node) { |
695 // If [node] is not a type literal is the class name of a static access, | 695 return elements.isTypeLiteral(node) ? types.typeType : types.dynamicType; |
696 // in which case we don't use the type mask. | |
697 return elements.isTypeLiteral(node) ? types.typeType : null; | |
698 } | 696 } |
699 | 697 |
700 bool isThisOrSuper(Node node) => node.isThis() || node.isSuper(); | 698 bool isThisOrSuper(Node node) => node.isThis() || node.isSuper(); |
701 | 699 |
702 Element get outermostElement { | 700 Element get outermostElement { |
703 return | 701 return |
704 analyzedElement.getOutermostEnclosingMemberOrTopLevel().implementation; | 702 analyzedElement.getOutermostEnclosingMemberOrTopLevel().implementation; |
705 } | 703 } |
706 | 704 |
707 T _thisType; | 705 T _thisType; |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 return type; | 1144 return type; |
1147 } | 1145 } |
1148 | 1146 |
1149 T visitCascade(Cascade node) { | 1147 T visitCascade(Cascade node) { |
1150 // Ignore the result of the cascade send and return the type of the cascade | 1148 // Ignore the result of the cascade send and return the type of the cascade |
1151 // receiver. | 1149 // receiver. |
1152 visit(node.expression); | 1150 visit(node.expression); |
1153 return cascadeReceiverStack.removeLast(); | 1151 return cascadeReceiverStack.removeLast(); |
1154 } | 1152 } |
1155 } | 1153 } |
OLD | NEW |