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

Unified Diff: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java

Issue 10703046: Issue 3753. Support for @deprecated annotation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 months 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 side-by-side diff with in-line comments
Download patch
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)) {

Powered by Google App Engine
This is Rietveld 408576698