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

Side by Side Diff: pkg/compiler/lib/src/inferrer/inferrer_visitor.dart

Issue 1421003004: Add CoreClasses (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 years, 1 month 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
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 'dart:collection' show 7 import 'dart:collection' show
8 IterableMixin; 8 IterableMixin;
9 9
10 import '../common.dart'; 10 import '../common.dart';
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 } 864 }
865 865
866 T visitLiteralNull(LiteralNull node) { 866 T visitLiteralNull(LiteralNull node) {
867 return types.nullType; 867 return types.nullType;
868 } 868 }
869 869
870 T visitLiteralSymbol(LiteralSymbol node) { 870 T visitLiteralSymbol(LiteralSymbol node) {
871 // TODO(kasperl): We should be able to tell that the type of a literal 871 // TODO(kasperl): We should be able to tell that the type of a literal
872 // symbol is always a non-null exact symbol implementation -- not just 872 // symbol is always a non-null exact symbol implementation -- not just
873 // any non-null subtype of the symbol interface. 873 // any non-null subtype of the symbol interface.
874 return types.nonNullSubtype(compiler.symbolClass); 874 return types.nonNullSubtype(compiler.coreClasses.symbolClass);
875 } 875 }
876 876
877 @override 877 @override
878 void previsitDeferredAccess(Send node, PrefixElement prefix, _) { 878 void previsitDeferredAccess(Send node, PrefixElement prefix, _) {
879 // Deferred access does not affect inference. 879 // Deferred access does not affect inference.
880 } 880 }
881 881
882 T handleTypeLiteralGet() { 882 T handleTypeLiteralGet() {
883 return types.typeType; 883 return types.typeType;
884 } 884 }
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 || (operator == '!=' && !usePositive)) { 1059 || (operator == '!=' && !usePositive)) {
1060 // Type the elements as null. 1060 // Type the elements as null.
1061 if (Elements.isLocal(receiverElement)) { 1061 if (Elements.isLocal(receiverElement)) {
1062 locals.update(receiverElement, types.nullType, node); 1062 locals.update(receiverElement, types.nullType, node);
1063 } 1063 }
1064 if (Elements.isLocal(argumentElement)) { 1064 if (Elements.isLocal(argumentElement)) {
1065 locals.update(argumentElement, types.nullType, node); 1065 locals.update(argumentElement, types.nullType, node);
1066 } 1066 }
1067 } else { 1067 } else {
1068 // Narrow the elements to a non-null type. 1068 // Narrow the elements to a non-null type.
1069 DartType objectType = compiler.objectClass.rawType; 1069 DartType objectType = compiler.coreTypes.objectType;
1070 if (Elements.isLocal(receiverElement)) { 1070 if (Elements.isLocal(receiverElement)) {
1071 narrow(receiverElement, objectType, node); 1071 narrow(receiverElement, objectType, node);
1072 } 1072 }
1073 if (Elements.isLocal(argumentElement)) { 1073 if (Elements.isLocal(argumentElement)) {
1074 narrow(argumentElement, objectType, node); 1074 narrow(argumentElement, objectType, node);
1075 } 1075 }
1076 } 1076 }
1077 } 1077 }
1078 } 1078 }
1079 } 1079 }
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 return type; 1535 return type;
1536 } 1536 }
1537 1537
1538 T visitCascade(Cascade node) { 1538 T visitCascade(Cascade node) {
1539 // Ignore the result of the cascade send and return the type of the cascade 1539 // Ignore the result of the cascade send and return the type of the cascade
1540 // receiver. 1540 // receiver.
1541 visit(node.expression); 1541 visit(node.expression);
1542 return cascadeReceiverStack.removeLast(); 1542 return cascadeReceiverStack.removeLast();
1543 } 1543 }
1544 } 1544 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/elements/modelx.dart ('k') | pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698