Chromium Code Reviews| 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 aa8719b0e614e4a9920b80e44279d588eb610438..bef02e6766a6a54c820d433c9a363f3284349f9a 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; |
|
ahe
2017/06/01 09:10:09
I also have to "steal" all these changes :-)
|
| } |
| } |
| -/// 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; |