Chromium Code Reviews| Index: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java |
| diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java |
| index 2d367b89840ade2eade806945e3d0305d7e66012..e63d279b7337ddb4b72b3a552f3704ae12fc9af8 100644 |
| --- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java |
| +++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java |
| @@ -1224,6 +1224,10 @@ public class TypeAnalyzer implements DartCompilationPhase { |
| if (nameNode != null) { |
| nameNode.setElement(methodElement); |
| } |
| + // @deprecated |
| + if (methodElement != null && methodElement.getMetadata().isDeprecated()) { |
|
Brian Wilkerson
2012/06/29 16:17:49
This needs to be copied into visitBinaryExpression
scheglov
2012/06/29 20:11:57
Done.
|
| + onError(nameNode, TypeErrorCode.DEPRECATED_ELEMENT, name); |
| + } |
| } |
| FunctionType methodType = getMethodType(receiver, member, name, nameNode); |
| return checkInvocation(node, nameNode, name, methodType); |
| @@ -1954,6 +1958,11 @@ public class TypeAnalyzer implements DartCompilationPhase { |
| TypeErrorCode.STATIC_MEMBER_ACCESSED_THROUGH_INSTANCE, |
| name, element.getName()); |
| } |
| + // @deprecated |
| + if (element != null && element.getMetadata().isDeprecated()) { |
| + onError(node.getName(), TypeErrorCode.DEPRECATED_ELEMENT, name); |
| + } |
| + // analyze Element |
| switch (element.getKind()) { |
| case DYNAMIC: |
| return dynamicType; |
| @@ -2214,6 +2223,10 @@ public class TypeAnalyzer implements DartCompilationPhase { |
| } |
| return voidType; |
| } |
| + // @deprecated |
| + if (element != null && element.getMetadata().isDeprecated()) { |
| + onError(target, TypeErrorCode.DEPRECATED_ELEMENT, name); |
| + } |
| // normal invocation |
| Type type; |
| switch (ElementKind.of(element)) { |