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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java

Issue 11569014: Issue 6974. Report warning when arguments are given for 'dynamic' or type variable. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
index ee9743b770af253d397631431892a8a911bd9f8e..cd7e2b1b9b2472aa9db0495b04218ff05cf6ec6a 100644
--- a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
+++ b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
@@ -223,6 +223,7 @@ public class ResolutionContext implements ResolutionErrorListener {
}
case CLASS:
case FUNCTION_TYPE_ALIAS:
+ case DYNAMIC:
return instantiateParameterizedType(
(ClassElement) element,
diagnosticNode,
@@ -243,13 +244,9 @@ public class ResolutionContext implements ResolutionErrorListener {
onError(identifier, duplicateErrorCode, element.getName(), locations.size(), locations);
return typeProvider.getDynamicType();
}
+ case VOID:
+ return typeProvider.getVoidType();
case NONE:
- if (Elements.isIdentifierName(identifier, "void")) {
- return typeProvider.getVoidType();
- }
- if (Elements.isIdentifierName(identifier, "dynamic")) {
- return typeProvider.getDynamicType();
- }
onError(identifier, errorCode, identifier);
return typeProvider.getDynamicType();
default:
@@ -315,6 +312,12 @@ public class ResolutionContext implements ResolutionErrorListener {
* Interpret this node as a name reference,
*/
Element resolveName(DartNode node) {
+ if (Elements.isIdentifierName(node, "void")) {
+ return typeProvider.getVoidType().getElement();
+ }
+ if (Elements.isIdentifierName(node, "dynamic")) {
+ return typeProvider.getDynamicType().getElement();
+ }
return node.accept(new Selector());
}
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698