| Index: compiler/java/com/google/dart/compiler/resolver/MemberBuilder.java
|
| diff --git a/compiler/java/com/google/dart/compiler/resolver/MemberBuilder.java b/compiler/java/com/google/dart/compiler/resolver/MemberBuilder.java
|
| index 7c9b55be3a3a163040f398f3933a786b0d372ebd..6f5280992e3b27e91f10e87ca12ccbf23fd5045f 100644
|
| --- a/compiler/java/com/google/dart/compiler/resolver/MemberBuilder.java
|
| +++ b/compiler/java/com/google/dart/compiler/resolver/MemberBuilder.java
|
| @@ -8,8 +8,6 @@ import com.google.common.annotations.VisibleForTesting;
|
| import com.google.common.base.Objects;
|
| import com.google.dart.compiler.DartCompilerContext;
|
| import com.google.dart.compiler.ErrorCode;
|
| -import com.google.dart.compiler.PackageLibraryManager;
|
| -import com.google.dart.compiler.Source;
|
| import com.google.dart.compiler.ast.ASTVisitor;
|
| import com.google.dart.compiler.ast.DartBlock;
|
| import com.google.dart.compiler.ast.DartClass;
|
| @@ -584,9 +582,10 @@ public class MemberBuilder {
|
|
|
| if (modifiers.isFactory()) {
|
| if (modifiers.isConstant()) {
|
| - // Allow const factory ... native ... ; type of constructors, used in core libraries
|
| + // Allow const factory ... native ... ; type of constructors, used in core libraries.
|
| + // Allow const factory redirecting.
|
| DartBlock dartBlock = method.getFunction().getBody();
|
| - if (dartBlock == null || !(dartBlock instanceof DartNativeBlock)) {
|
| + if (!(dartBlock instanceof DartNativeBlock || method.getRedirectedTypeName() != null)) {
|
| resolutionError(method.getName(), ResolverErrorCode.FACTORY_CANNOT_BE_CONST);
|
| }
|
| }
|
|
|