Dead block removed (function literal inside do...while)

This commit is contained in:
Mikhail Glukhikh
2015-04-23 18:18:21 +03:00
parent b40fe9d5ba
commit 8b241b8c05
@@ -305,18 +305,8 @@ public class ControlStructureTypingVisitor extends ExpressionTypingVisitor {
// See KT-6283
JetTypeInfo bodyTypeInfo;
if (body instanceof JetFunctionLiteralExpression) {
JetFunctionLiteralExpression function = (JetFunctionLiteralExpression) body;
JetFunctionLiteral functionLiteral = function.getFunctionLiteral();
if (!functionLiteral.hasParameterSpecification()) {
WritableScope writableScope = newWritableScopeImpl(context, "do..while body scope");
conditionScope = writableScope;
bodyTypeInfo = components.expressionTypingServices.getBlockReturnedTypeWithWritableScope(
writableScope, functionLiteral.getBodyExpression().getStatements(), CoercionStrategy.NO_COERCION, context);
context.trace.record(BindingContext.BLOCK, function);
}
else {
bodyTypeInfo = facade.getTypeInfo(body, context.replaceScope(context.scope));
}
// As a matter of fact, function literal is always unused at this point
bodyTypeInfo = facade.getTypeInfo(body, context.replaceScope(context.scope));
}
else if (body != null) {
WritableScope writableScope = newWritableScopeImpl(context, "do..while body scope");