File tree 5 files changed +12
-13
lines changed
5 files changed +12
-13
lines changed Original file line number Diff line number Diff line change 2
2
* Added 'dart/sdk/build_sdk_summary.dart' with ` buildSdkSummary ` .
3
3
* Added ` DynamicType ` , ` NeverType ` , and ` VoidType ` interfaces.
4
4
* Added ` TypeVisitor ` and ` DartType.accept(TypeVisitor) ` .
5
+ * Changed ` ConstructorElement.returnType ` to ` InterfaceType ` .
5
6
6
7
## 0.39.12
7
8
* Deprecated ` canUseSummaries ` in ` DartSdkManager ` constructor.
Original file line number Diff line number Diff line change @@ -487,6 +487,9 @@ abstract class ConstructorElement
487
487
/// if this constructor does not redirect to another constructor or if the
488
488
/// library containing this constructor has not yet been resolved.
489
489
ConstructorElement get redirectedConstructor;
490
+
491
+ @override
492
+ InterfaceType get returnType;
490
493
}
491
494
492
495
/// The base class for all of the elements in the element model. Generally
Original file line number Diff line number Diff line change @@ -355,8 +355,7 @@ class ConstantEvaluationEngine {
355
355
if (defaultSuperInvocationNeeded) {
356
356
// No explicit superconstructor invocation found, so we need to
357
357
// manually insert a reference to the implicit superconstructor.
358
- InterfaceType superclass =
359
- (constant.returnType as InterfaceType ).superclass;
358
+ InterfaceType superclass = (constant.returnType).superclass;
360
359
if (superclass != null && ! superclass.isDartCoreObject) {
361
360
ConstructorElement unnamedConstructor =
362
361
superclass.element.unnamedConstructor? .declaration;
@@ -476,7 +475,7 @@ class ConstantEvaluationEngine {
476
475
);
477
476
478
477
constructor = followConstantRedirectionChain (constructor);
479
- InterfaceType definingClass = constructor.returnType as InterfaceType ;
478
+ InterfaceType definingClass = constructor.returnType;
480
479
if (constructor.isFactory) {
481
480
// We couldn't find a non-factory constructor.
482
481
// See if it's because we reached an external const factory constructor
Original file line number Diff line number Diff line change @@ -2143,7 +2143,7 @@ class ConstructorElementImpl extends ExecutableElementImpl
2143
2143
}
2144
2144
2145
2145
@override
2146
- DartType get returnType =>
2146
+ InterfaceType get returnType =>
2147
2147
ElementTypeProvider .current.getExecutableReturnType (this );
2148
2148
2149
2149
@override
@@ -2152,15 +2152,8 @@ class ConstructorElementImpl extends ExecutableElementImpl
2152
2152
}
2153
2153
2154
2154
@override
2155
- DartType get returnTypeInternal {
2156
- if (_returnType != null ) return _returnType;
2157
-
2158
- InterfaceTypeImpl classThisType = enclosingElement.thisType;
2159
- return _returnType = InterfaceTypeImpl (
2160
- element: classThisType.element,
2161
- typeArguments: classThisType.typeArguments,
2162
- nullabilitySuffix: classThisType.nullabilitySuffix,
2163
- );
2155
+ InterfaceType get returnTypeInternal {
2156
+ return _returnType ?? = enclosingElement.thisType;
2164
2157
}
2165
2158
2166
2159
@override
Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ class ConstructorMember extends ExecutableMember implements ConstructorElement {
83
83
return ConstructorMember (declaration, substitution, false );
84
84
}
85
85
86
+ @override
87
+ InterfaceType get returnType => type.returnType as InterfaceType ;
88
+
86
89
@override
87
90
T accept <T >(ElementVisitor <T > visitor) =>
88
91
visitor.visitConstructorElement (this );
You can’t perform that action at this time.
0 commit comments