Index: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart |
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart |
index 21b0ecf8f1761ee2ce042e7c44c4f84cb8aacf8a..587fd496fcd17670c498fb1b70fa808dea8e82d3 100644 |
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart |
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart |
@@ -37,31 +37,10 @@ InterfaceType computeConstructorReturnType(Member constructor) { |
if (constructor is Constructor) { |
return constructor.enclosingClass.thisType; |
} else { |
- return computeFactoryConstructorReturnType(constructor); |
+ return constructor.function.returnType; |
} |
} |
-/// Computes the return type of a factory constructor. |
-/// |
-/// Note that we can't just use `constructor.function.functionType.returnType`, |
-/// because that's `dynamic` for factory constructors. TODO(paulberry): |
-/// investigate whether this can be changed. |
-InterfaceType computeFactoryConstructorReturnType(Procedure constructor) { |
- var returnType = constructor.enclosingClass.thisType; |
- if (constructor.enclosingClass.typeParameters.isNotEmpty) { |
- // target.enclosingClass.typeParameters is not the same as |
- // target.function.functionType.typeParameters, so we have to substitute. |
- returnType = Substitution |
- .fromPairs( |
- constructor.enclosingClass.typeParameters, |
- constructor.function.functionType.typeParameters |
- .map((p) => new TypeParameterType(p)) |
- .toList()) |
- .substituteType(returnType); |
- } |
- return returnType; |
-} |
- |
List<DartType> getExplicitTypeArguments(Arguments arguments) { |
if (arguments is KernelArguments) { |
return arguments._hasExplicitTypeArguments ? arguments.types : null; |