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

Unified Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2033293003: Compute ConstructorElement.returnType/type dynamically. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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: pkg/analyzer/lib/src/dart/element/element.dart
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index 7c1e056917cbf7af237cbf95e6229ffb651e92c1..0e62f2391d83a023947777444115f7e606ef1592 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -1085,7 +1085,6 @@ class ClassElementImpl extends AbstractClassElementImpl
new ConstructorElementImpl(superclassConstructor.name, -1);
implicitConstructor.synthetic = true;
implicitConstructor.redirectedConstructor = superclassConstructor;
- implicitConstructor.returnType = type;
List<ParameterElement> superParameters = superclassConstructor.parameters;
int count = superParameters.length;
if (count > 0) {
@@ -1106,7 +1105,6 @@ class ClassElementImpl extends AbstractClassElementImpl
implicitConstructor.parameters = implicitParameters;
}
implicitConstructor.enclosingElement = this;
- implicitConstructor.type = new FunctionTypeImpl(implicitConstructor);
return implicitConstructor;
}).toList(growable: false);
}
@@ -1882,6 +1880,19 @@ class ConstructorElementImpl extends ExecutableElementImpl
@override
DartType get returnType => enclosingElement.type;
+ void set returnType(DartType returnType) {
+ assert(false);
+ }
+
+ @override
+ FunctionType get type {
+ return _type ??= new FunctionTypeImpl(this);
+ }
+
+ void set type(FunctionType type) {
+ assert(false);
+ }
+
@override
accept(ElementVisitor visitor) => visitor.visitConstructorElement(this);

Powered by Google App Engine
This is Rietveld 408576698