| OLD | NEW |
| 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 AnalyzableElement get analyzedElement; | 8 AnalyzableElement get analyzedElement; |
| 9 Iterable<Node> get superUses; | 9 Iterable<Node> get superUses; |
| 10 | 10 |
| (...skipping 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1866 // Try to construct the type from the element. | 1866 // Try to construct the type from the element. |
| 1867 if (element == null) { | 1867 if (element == null) { |
| 1868 type = reportFailureAndCreateType( | 1868 type = reportFailureAndCreateType( |
| 1869 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.typeName}); | 1869 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.typeName}); |
| 1870 } else if (element.isAmbiguous) { | 1870 } else if (element.isAmbiguous) { |
| 1871 AmbiguousElement ambiguous = element; | 1871 AmbiguousElement ambiguous = element; |
| 1872 type = reportFailureAndCreateType( | 1872 type = reportFailureAndCreateType( |
| 1873 ambiguous.messageKind, ambiguous.messageArguments); | 1873 ambiguous.messageKind, ambiguous.messageArguments); |
| 1874 ambiguous.diagnose(registry.mapping.analyzedElement, compiler); | 1874 ambiguous.diagnose(registry.mapping.analyzedElement, compiler); |
| 1875 } else if (element.isErroneous) { | 1875 } else if (element.isErroneous) { |
| 1876 ErroneousElement erroneousElement = element; | 1876 if (element is ErroneousElement) { |
| 1877 type = reportFailureAndCreateType( | 1877 type = reportFailureAndCreateType( |
| 1878 erroneousElement.messageKind, erroneousElement.messageArguments, | 1878 element.messageKind, element.messageArguments, |
| 1879 erroneousElement: erroneousElement); | 1879 erroneousElement: element); |
| 1880 } else { |
| 1881 type = const DynamicType(); |
| 1882 } |
| 1880 } else if (!element.impliesType) { | 1883 } else if (!element.impliesType) { |
| 1881 type = reportFailureAndCreateType( | 1884 type = reportFailureAndCreateType( |
| 1882 MessageKind.NOT_A_TYPE, {'node': node.typeName}); | 1885 MessageKind.NOT_A_TYPE, {'node': node.typeName}); |
| 1883 } else { | 1886 } else { |
| 1884 bool addTypeVariableBoundsCheck = false; | 1887 bool addTypeVariableBoundsCheck = false; |
| 1885 if (element.isClass) { | 1888 if (element.isClass) { |
| 1886 ClassElement cls = element; | 1889 ClassElement cls = element; |
| 1887 // TODO(johnniwinther): [_ensureClassWillBeResolved] should imply | 1890 // TODO(johnniwinther): [_ensureClassWillBeResolved] should imply |
| 1888 // [computeType]. | 1891 // [computeType]. |
| 1889 compiler.resolver._ensureClassWillBeResolved(cls); | 1892 compiler.resolver._ensureClassWillBeResolved(cls); |
| (...skipping 3125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5015 } | 5018 } |
| 5016 | 5019 |
| 5017 /// The result for the resolution of the `assert` method. | 5020 /// The result for the resolution of the `assert` method. |
| 5018 class AssertResult implements ResolutionResult { | 5021 class AssertResult implements ResolutionResult { |
| 5019 const AssertResult(); | 5022 const AssertResult(); |
| 5020 | 5023 |
| 5021 Element get element => null; | 5024 Element get element => null; |
| 5022 | 5025 |
| 5023 String toString() => 'AssertResult()'; | 5026 String toString() => 'AssertResult()'; |
| 5024 } | 5027 } |
| OLD | NEW |