| 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 simple_types_inferrer; | 5 library simple_types_inferrer; |
| 6 | 6 |
| 7 import '../closure.dart' show ClosureClassMap; | 7 import '../closure.dart' show ClosureClassMap; |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../common/names.dart' show Identifiers, Selectors; | 9 import '../common/names.dart' show Identifiers, Selectors; |
| 10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
| (...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 if (inferrer.hasAlreadyComputedTypeOfParameterDefault(element)) return; | 930 if (inferrer.hasAlreadyComputedTypeOfParameterDefault(element)) return; |
| 931 if (element.functionDeclaration != analyzedElement) { | 931 if (element.functionDeclaration != analyzedElement) { |
| 932 visitor = new ElementGraphBuilder(element.functionDeclaration, | 932 visitor = new ElementGraphBuilder(element.functionDeclaration, |
| 933 element.functionDeclaration.resolvedAst, compiler, inferrer); | 933 element.functionDeclaration.resolvedAst, compiler, inferrer); |
| 934 } | 934 } |
| 935 TypeInformation type = | 935 TypeInformation type = |
| 936 (defaultValue == null) ? types.nullType : visitor.visit(defaultValue); | 936 (defaultValue == null) ? types.nullType : visitor.visit(defaultValue); |
| 937 inferrer.setDefaultTypeOfParameter(element, type); | 937 inferrer.setDefaultTypeOfParameter(element, type); |
| 938 }); | 938 }); |
| 939 | 939 |
| 940 if (compiler.backend.isNative(analyzedElement)) { | 940 if (inferrer.isNativeMember(analyzedElement)) { |
| 941 // Native methods do not have a body, and we currently just say | 941 // Native methods do not have a body, and we currently just say |
| 942 // they return dynamic. | 942 // they return dynamic. |
| 943 return types.dynamicType; | 943 return types.dynamicType; |
| 944 } | 944 } |
| 945 | 945 |
| 946 if (analyzedElement.isGenerativeConstructor) { | 946 if (analyzedElement.isGenerativeConstructor) { |
| 947 isThisExposed = false; | 947 isThisExposed = false; |
| 948 signature.forEachParameter((ParameterElement element) { | 948 signature.forEachParameter((ParameterElement element) { |
| 949 TypeInformation parameterType = inferrer.typeOfElement(element); | 949 TypeInformation parameterType = inferrer.typeOfElement(element); |
| 950 if (element.isInitializingFormal) { | 950 if (element.isInitializingFormal) { |
| (...skipping 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2931 Selector moveNextSelector = Selectors.moveNext; | 2931 Selector moveNextSelector = Selectors.moveNext; |
| 2932 TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node); | 2932 TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node); |
| 2933 | 2933 |
| 2934 TypeInformation iteratorType = handleDynamicSend(node, iteratorSelector, | 2934 TypeInformation iteratorType = handleDynamicSend(node, iteratorSelector, |
| 2935 iteratorMask, expressionType, new ArgumentsTypes.empty()); | 2935 iteratorMask, expressionType, new ArgumentsTypes.empty()); |
| 2936 | 2936 |
| 2937 return handleForInLoop(node, iteratorType, currentSelector, currentMask, | 2937 return handleForInLoop(node, iteratorType, currentSelector, currentMask, |
| 2938 moveNextSelector, moveNextMask); | 2938 moveNextSelector, moveNextMask); |
| 2939 } | 2939 } |
| 2940 } | 2940 } |
| OLD | NEW |