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

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

Issue 10984033: Tweaks for @deprecated and @override presentation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 Type type = getContext().resolveType(node, isStatic, isFactory, isAnnotation , errorCode, 136 Type type = getContext().resolveType(node, isStatic, isFactory, isAnnotation , errorCode,
137 wrongNumberErrorCode); 137 wrongNumberErrorCode);
138 if (type == null) { 138 if (type == null) {
139 type = getTypeProvider().getDynamicType(); 139 type = getTypeProvider().getDynamicType();
140 } 140 }
141 node.setType(type); 141 node.setType(type);
142 Element element = type.getElement(); 142 Element element = type.getElement();
143 recordElement(node.getIdentifier(), element); 143 recordElement(node.getIdentifier(), element);
144 if (element != null && element.getMetadata().isDeprecated()) { 144 if (element != null && element.getMetadata().isDeprecated()) {
145 getContext().onError(node.getIdentifier(), TypeErrorCode.DEPRECATED_ELEMEN T, 145 getContext().onError(node.getIdentifier(), TypeErrorCode.DEPRECATED_ELEMEN T,
146 element.getName()); 146 Elements.getDeprecatedElementTitle(element));
147 } 147 }
148 return type; 148 return type;
149 } 149 }
150 150
151 protected <E extends Element> E recordElement(DartNode node, E element) { 151 protected <E extends Element> E recordElement(DartNode node, E element) {
152 node.getClass(); 152 node.getClass();
153 if (element == null) { 153 if (element == null) {
154 // TypeAnalyzer will diagnose unresolved identifiers. 154 // TypeAnalyzer will diagnose unresolved identifiers.
155 return null; 155 return null;
156 } 156 }
157 node.setElement(element); 157 node.setElement(element);
158 return element; 158 return element;
159 } 159 }
160 160
161 CoreTypeProvider getTypeProvider() { 161 CoreTypeProvider getTypeProvider() {
162 return typeProvider; 162 return typeProvider;
163 } 163 }
164 } 164 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698