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

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

Issue 12038040: Issue 7802. Fix for redundant casts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/type/Types.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/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 f244fad5c4fce5840497893743d0d6a0626c3ba2..0935dbe4dccf8a89223af6c4f2bdb670eb5e0cc6 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -2192,7 +2192,7 @@ public class TypeAnalyzer implements DartCompilationPhase {
}
private void analyzeFactory(DartMethodDefinition node, DartExpression name,
- final ConstructorElement methodElement) {
+ final ConstructorElement constructorElement) {
ASTVisitor<Void> visitor = new ASTVisitor<Void>() {
@Override
public Void visitParameterizedTypeNode(DartParameterizedTypeNode node) {
@@ -2213,12 +2213,11 @@ public class TypeAnalyzer implements DartCompilationPhase {
};
name.accept(visitor);
// redirecting factory constructor
- if (methodElement instanceof ConstructorElement) {
- ConstructorElement constructorElement = (ConstructorElement) methodElement;
+ {
ConstructorElement targetElement = constructorElement.getRedirectingFactoryConstructor();
if (targetElement != null) {
ClassElement targetEnclosingClass = (ClassElement) targetElement.getEnclosingElement();
- Type sourceMethodType = methodElement.getType();
+ Type sourceMethodType = constructorElement.getType();
Type targetMethodType = targetElement.getType();
InterfaceType targetClassType = (InterfaceType) node.getRedirectedTypeName().getType();
targetMethodType = targetMethodType.subst(targetClassType.getArguments(),
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/type/Types.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698