| Index: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
|
| diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
|
| index 4b491d15756f1d97bedad8e20192abca4df97b17..c9761333d2a33ed23b0db34c9bfc79ffed9ce477 100644
|
| --- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
|
| +++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
|
| @@ -996,8 +996,14 @@ public class TypeAnalyzer implements DartCompilationPhase {
|
| @Override
|
| public Type visitMethodDefinition(DartMethodDefinition node) {
|
| MethodElement methodElement = node.getSymbol();
|
| - if (methodElement.getModifiers().isFactory()) {
|
| + Modifiers modifiers = methodElement.getModifiers();
|
| + if (modifiers.isFactory()) {
|
| analyzeFactory(node.getName(), (ConstructorElement) methodElement);
|
| + } else if (modifiers.isSetter()) {
|
| + DartTypeNode returnType = node.getFunction().getReturnTypeNode();
|
| + if (returnType != null && returnType.getType() != voidType) {
|
| + typeError(returnType, TypeErrorCode.SETTER_RETURN_TYPE, methodElement.getName());
|
| + }
|
| }
|
| return typeAsVoid(node);
|
| }
|
|
|