| Index: frog/leg/typechecker.dart
|
| diff --git a/frog/leg/typechecker.dart b/frog/leg/typechecker.dart
|
| index d4575baa42176dc0a8073cae854a3fe70e78dff5..6f694f1cc41776ee046f0aef94b47b7f954f2fa3 100644
|
| --- a/frog/leg/typechecker.dart
|
| +++ b/frog/leg/typechecker.dart
|
| @@ -238,9 +238,19 @@ class TypeCheckerVisitor implements Visitor<Type> {
|
| }
|
|
|
| Type visitFunctionExpression(FunctionExpression node) {
|
| + Type type;
|
| + Type returnType;
|
| + Type previousType;
|
| final FunctionElement element = elements[node];
|
| - FunctionType functionType = computeType(element);
|
| - Type returnType = functionType.returnType;
|
| + if (element.kind === ElementKind.GENERATIVE_CONSTRUCTOR ||
|
| + element.kind === ElementKind.GENERATIVE_CONSTRUCTOR_BODY) {
|
| + type = types.dynamicType;
|
| + returnType = types.voidType;
|
| + } else {
|
| + FunctionType functionType = computeType(element);
|
| + returnType = functionType.returnType;
|
| + type = functionType;
|
| + }
|
| Type previous = expectedReturnType;
|
| expectedReturnType = returnType;
|
| if (element.isMember()) currentClass = element.enclosingElement;
|
| @@ -256,7 +266,7 @@ class TypeCheckerVisitor implements Visitor<Type> {
|
| reportTypeWarning(node.name, kind);
|
| }
|
| expectedReturnType = previous;
|
| - return functionType;
|
| + return type;
|
| }
|
|
|
| Type visitIdentifier(Identifier node) {
|
|
|