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

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

Issue 10970024: Issue 5240. Using a non-type in a const object expression is an error, not a warning (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 9d79a55052adba4e78c990f0982e5f24fe21ae12..01d50c69e5508759e5358fc3b2c2bfb25c1b7f67 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -2168,7 +2168,7 @@ public class TypeAnalyzer implements DartCompilationPhase {
}
List<Type> arguments = ifaceType.getArguments();
ftype = (FunctionType) ftype.subst(arguments, substParams);
- checkDeprecated(getConstructorNameNode(node), constructorElement);
+ checkDeprecated(ASTNodes.getConstructorNameNode(node), constructorElement);
checkInvocation(node, node, constructorElement.getName(), ftype);
}
}
@@ -2949,27 +2949,6 @@ public class TypeAnalyzer implements DartCompilationPhase {
return hasFunctionTypeAliasReference(visited, target, current);
}
- /**
- * @return the {@link DartIdentifier} corresponding to the name of constructor.
- */
- public static DartIdentifier getConstructorNameNode(DartNewExpression node) {
- DartNode constructor = node.getConstructor();
- return getConstructorNameNode(constructor);
- }
-
- /**
- * @return the {@link DartIdentifier} corresponding to the name of constructor.
- */
- public static DartIdentifier getConstructorNameNode(DartNode constructor) {
- if (constructor instanceof DartPropertyAccess) {
- return ((DartPropertyAccess) constructor).getName();
- } else if (constructor instanceof DartTypeNode) {
- return getConstructorNameNode(((DartTypeNode) constructor).getIdentifier());
- } else {
- return (DartIdentifier) constructor;
- }
- }
-
@Override
public Type visitIntegerLiteral(DartIntegerLiteral node) {
return typeOfLiteral(node);

Powered by Google App Engine
This is Rietveld 408576698