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

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

Issue 10983089: Issue 3968. Report error if cycle in redirecting factory constructors (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.ast.DartIdentifier; 7 import com.google.dart.compiler.ast.DartIdentifier;
8 import com.google.dart.compiler.ast.DartMethodDefinition; 8 import com.google.dart.compiler.ast.DartMethodDefinition;
9 import com.google.dart.compiler.ast.DartNode; 9 import com.google.dart.compiler.ast.DartNode;
10 import com.google.dart.compiler.ast.DartParameterizedTypeNode; 10 import com.google.dart.compiler.ast.DartParameterizedTypeNode;
11 import com.google.dart.compiler.ast.DartPropertyAccess; 11 import com.google.dart.compiler.ast.DartPropertyAccess;
12 12
13 class ConstructorElementImplementation extends MethodElementImplementation 13 class ConstructorElementImplementation extends MethodElementImplementation
14 implements ConstructorNodeElement { 14 implements ConstructorNodeElement {
15 private final ClassElement constructorType; 15 private final ClassElement constructorType;
16 private final String rawName; 16 private final String rawName;
17 private ConstructorElement defaultConstructor; 17 private ConstructorElement defaultConstructor;
18 private ConstructorElement redirectingFactoryConstructor;
18 19
19 private ConstructorElementImplementation(DartMethodDefinition node, 20 private ConstructorElementImplementation(DartMethodDefinition node,
20 String name, 21 String name,
21 ClassElement declaringClass, 22 ClassElement declaringClass,
22 ClassElement constructorType) { 23 ClassElement constructorType) {
23 super(node, name, declaringClass); 24 super(node, name, declaringClass);
24 this.constructorType = constructorType; 25 this.constructorType = constructorType;
25 this.rawName = getRawName(node.getName()); 26 this.rawName = getRawName(node.getName());
26 } 27 }
27 28
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 @Override 69 @Override
69 public ConstructorElement getDefaultConstructor() { 70 public ConstructorElement getDefaultConstructor() {
70 return defaultConstructor; 71 return defaultConstructor;
71 } 72 }
72 73
73 @Override 74 @Override
74 public void setDefaultConstructor(ConstructorElement defaultConstructor) { 75 public void setDefaultConstructor(ConstructorElement defaultConstructor) {
75 this.defaultConstructor = defaultConstructor; 76 this.defaultConstructor = defaultConstructor;
76 } 77 }
77 78
79 @Override
80 public ConstructorElement getRedirectingFactoryConstructor() {
81 return redirectingFactoryConstructor;
82 }
83
84 public void setRedirectingFactoryConstructor(ConstructorElement redirectingFac toryConstructor) {
85 this.redirectingFactoryConstructor = redirectingFactoryConstructor;
86 }
87
78 public static ConstructorElementImplementation fromMethodNode(DartMethodDefini tion node, 88 public static ConstructorElementImplementation fromMethodNode(DartMethodDefini tion node,
79 String name, 89 String name,
80 ClassElement declaringClass, 90 ClassElement declaringClass,
81 ClassElement constructorType) { 91 ClassElement constructorType) {
82 return new ConstructorElementImplementation(node, name, declaringClass, cons tructorType); 92 return new ConstructorElementImplementation(node, name, declaringClass, cons tructorType);
83 } 93 }
84 } 94 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698