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

Side by Side Diff: compiler/java/com/google/dart/compiler/resolver/ResolveVisitor.java

Issue 10703046: Issue 3753. Support for @deprecated annotation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Analyze for @deprecated all invocable elements Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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.dart.compiler.ErrorCode; 7 import com.google.dart.compiler.ErrorCode;
8 import com.google.dart.compiler.ast.ASTVisitor; 8 import com.google.dart.compiler.ast.ASTVisitor;
9 import com.google.dart.compiler.ast.DartCatchBlock; 9 import com.google.dart.compiler.ast.DartCatchBlock;
10 import com.google.dart.compiler.ast.DartFunction; 10 import com.google.dart.compiler.ast.DartFunction;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 ErrorCode errorCode, ErrorCode wrongNumberErrorCode) { 130 ErrorCode errorCode, ErrorCode wrongNumberErrorCode) {
131 if (node == null) { 131 if (node == null) {
132 return getTypeProvider().getDynamicType(); 132 return getTypeProvider().getDynamicType();
133 } 133 }
134 assert node.getType() == null || node.getType() instanceof DynamicType; 134 assert node.getType() == null || node.getType() instanceof DynamicType;
135 Type type = getContext().resolveType(node, isStatic, isFactory, errorCode, w rongNumberErrorCode); 135 Type type = getContext().resolveType(node, isStatic, isFactory, errorCode, w rongNumberErrorCode);
136 if (type == null) { 136 if (type == null) {
137 type = getTypeProvider().getDynamicType(); 137 type = getTypeProvider().getDynamicType();
138 } 138 }
139 node.setType(type); 139 node.setType(type);
140 recordElement(node.getIdentifier(), type.getElement()); 140 Element element = type.getElement();
141 recordElement(node.getIdentifier(), element);
142 if (element != null && element.getMetadata().isDeprecated()) {
143 getContext().onError(node.getIdentifier(), TypeErrorCode.DEPRECATED_ELEMEN T, element.getName());
144 }
141 return type; 145 return type;
142 } 146 }
143 147
144 protected <E extends Element> E recordElement(DartNode node, E element) { 148 protected <E extends Element> E recordElement(DartNode node, E element) {
145 node.getClass(); 149 node.getClass();
146 if (element == null) { 150 if (element == null) {
147 // TypeAnalyzer will diagnose unresolved identifiers. 151 // TypeAnalyzer will diagnose unresolved identifiers.
148 return null; 152 return null;
149 } 153 }
150 node.setElement(element); 154 node.setElement(element);
151 return element; 155 return element;
152 } 156 }
153 157
154 CoreTypeProvider getTypeProvider() { 158 CoreTypeProvider getTypeProvider() {
155 return typeProvider; 159 return typeProvider;
156 } 160 }
157 } 161 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698