Dead block removed (function literal inside do...while)
This commit is contained in:
+2
-12
@@ -305,18 +305,8 @@ public class ControlStructureTypingVisitor extends ExpressionTypingVisitor {
|
|||||||
// See KT-6283
|
// See KT-6283
|
||||||
JetTypeInfo bodyTypeInfo;
|
JetTypeInfo bodyTypeInfo;
|
||||||
if (body instanceof JetFunctionLiteralExpression) {
|
if (body instanceof JetFunctionLiteralExpression) {
|
||||||
JetFunctionLiteralExpression function = (JetFunctionLiteralExpression) body;
|
// As a matter of fact, function literal is always unused at this point
|
||||||
JetFunctionLiteral functionLiteral = function.getFunctionLiteral();
|
bodyTypeInfo = facade.getTypeInfo(body, context.replaceScope(context.scope));
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (body != null) {
|
else if (body != null) {
|
||||||
WritableScope writableScope = newWritableScopeImpl(context, "do..while body scope");
|
WritableScope writableScope = newWritableScopeImpl(context, "do..while body scope");
|
||||||
|
|||||||
Reference in New Issue
Block a user