File tree Expand file tree Collapse file tree 5 files changed +12
-13
lines changed Expand file tree Collapse file tree 5 files changed +12
-13
lines changed Original file line number Diff line number Diff line change 22* Added 'dart/sdk/build_sdk_summary.dart' with ` buildSdkSummary ` .
33* Added ` DynamicType ` , ` NeverType ` , and ` VoidType ` interfaces.
44* Added ` TypeVisitor ` and ` DartType.accept(TypeVisitor) ` .
5+ * Changed ` ConstructorElement.returnType ` to ` InterfaceType ` .
56
67## 0.39.12
78* Deprecated ` canUseSummaries ` in ` DartSdkManager ` constructor.
Original file line number Diff line number Diff line change @@ -487,6 +487,9 @@ abstract class ConstructorElement
487487 /// if this constructor does not redirect to another constructor or if the
488488 /// library containing this constructor has not yet been resolved.
489489 ConstructorElement get redirectedConstructor;
490+
491+ @override
492+ InterfaceType get returnType;
490493}
491494
492495/// 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 {
355355 if (defaultSuperInvocationNeeded) {
356356 // No explicit superconstructor invocation found, so we need to
357357 // manually insert a reference to the implicit superconstructor.
358- InterfaceType superclass =
359- (constant.returnType as InterfaceType ).superclass;
358+ InterfaceType superclass = (constant.returnType).superclass;
360359 if (superclass != null && ! superclass.isDartCoreObject) {
361360 ConstructorElement unnamedConstructor =
362361 superclass.element.unnamedConstructor? .declaration;
@@ -476,7 +475,7 @@ class ConstantEvaluationEngine {
476475 );
477476
478477 constructor = followConstantRedirectionChain (constructor);
479- InterfaceType definingClass = constructor.returnType as InterfaceType ;
478+ InterfaceType definingClass = constructor.returnType;
480479 if (constructor.isFactory) {
481480 // We couldn't find a non-factory constructor.
482481 // 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
21432143 }
21442144
21452145 @override
2146- DartType get returnType =>
2146+ InterfaceType get returnType =>
21472147 ElementTypeProvider .current.getExecutableReturnType (this );
21482148
21492149 @override
@@ -2152,15 +2152,8 @@ class ConstructorElementImpl extends ExecutableElementImpl
21522152 }
21532153
21542154 @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;
21642157 }
21652158
21662159 @override
Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ class ConstructorMember extends ExecutableMember implements ConstructorElement {
8383 return ConstructorMember (declaration, substitution, false );
8484 }
8585
86+ @override
87+ InterfaceType get returnType => type.returnType as InterfaceType ;
88+
8689 @override
8790 T accept <T >(ElementVisitor <T > visitor) =>
8891 visitor.visitConstructorElement (this );
You can’t perform that action at this time.
0 commit comments