isBlock fixed for doWhile

This commit is contained in:
Andrey Breslav
2011-04-02 23:29:23 +04:00
parent 81d75552a3
commit 90b6e78f89
4 changed files with 3 additions and 409 deletions
@@ -133,6 +133,6 @@ public class BindingTraceContext extends BindingTrace implements BindingContext
@Override
public boolean isBlock(JetFunctionLiteralExpression expression) {
return expression.hasParameterSpecification() || blocks.contains(expression);
return !expression.hasParameterSpecification() && blocks.contains(expression);
}
}
@@ -693,6 +693,7 @@ public class JetTypeInferrer {
WritableScope writableScope = semanticServices.createWritableScope(scope, scope.getContainingDeclaration());
conditionScope = writableScope;
getBlockReturnedTypeWithWritableScope(writableScope, function.getBody(), LabeledJumpDomain.ERROR); // TODO
trace.recordBlock(function);
} else {
getType(scope, body, true);
}