| 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 package com.google.dart.compiler.resolver; | 5 package com.google.dart.compiler.resolver; |
| 6 | 6 |
| 7 import com.google.common.annotations.VisibleForTesting; | 7 import com.google.common.annotations.VisibleForTesting; |
| 8 import com.google.common.collect.Lists; | 8 import com.google.common.collect.Lists; |
| 9 import com.google.common.collect.Sets; | 9 import com.google.common.collect.Sets; |
| 10 import com.google.dart.compiler.DartCompilationPhase; | 10 import com.google.dart.compiler.DartCompilationPhase; |
| (...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1654 name); | 1654 name); |
| 1655 break; | 1655 break; |
| 1656 | 1656 |
| 1657 case METHOD: { | 1657 case METHOD: { |
| 1658 assert !((MethodElement) element).getModifiers().isStatic(); | 1658 assert !((MethodElement) element).getModifiers().isStatic(); |
| 1659 onError(errorNode, ResolverErrorCode.IS_AN_INSTANCE_METHOD, | 1659 onError(errorNode, ResolverErrorCode.IS_AN_INSTANCE_METHOD, |
| 1660 classOrLibrary.getName(), name); | 1660 classOrLibrary.getName(), name); |
| 1661 break; | 1661 break; |
| 1662 } | 1662 } |
| 1663 | 1663 |
| 1664 case FIELD: { |
| 1665 onError(errorNode, ResolverErrorCode.IS_AN_INSTANCE_FIELD, |
| 1666 classOrLibrary.getName(), name); |
| 1667 break; |
| 1668 } |
| 1669 |
| 1664 default: | 1670 default: |
| 1665 throw context.internalError(errorNode, "Unexpected kind of element: %s
", kind); | 1671 throw context.internalError(errorNode, "Unexpected kind of element: %s
", kind); |
| 1666 } | 1672 } |
| 1667 } | 1673 } |
| 1668 | 1674 |
| 1669 private void diagnoseErrorInUnqualifiedInvocation(DartUnqualifiedInvocation
node) { | 1675 private void diagnoseErrorInUnqualifiedInvocation(DartUnqualifiedInvocation
node) { |
| 1670 String name = node.getTarget().getName(); | 1676 String name = node.getTarget().getName(); |
| 1671 Scope scope = getContext().getScope(); | 1677 Scope scope = getContext().getScope(); |
| 1672 Element element = scope.findElement(scope.getLibrary(), name); | 1678 Element element = scope.findElement(scope.getLibrary(), name); |
| 1673 ElementKind kind = ElementKind.of(element); | 1679 ElementKind kind = ElementKind.of(element); |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2196 ClassElement currentClass = (ClassElement) constructor.getEnclosingEle
ment(); | 2202 ClassElement currentClass = (ClassElement) constructor.getEnclosingEle
ment(); |
| 2197 if (nextClass == currentClass) { | 2203 if (nextClass == currentClass) { |
| 2198 return (ConstructorNodeElement) nextConstructorElement; | 2204 return (ConstructorNodeElement) nextConstructorElement; |
| 2199 } | 2205 } |
| 2200 } | 2206 } |
| 2201 } | 2207 } |
| 2202 } | 2208 } |
| 2203 return null; | 2209 return null; |
| 2204 } | 2210 } |
| 2205 } | 2211 } |
| OLD | NEW |