Fix typechecker in case of "for ((a, b) in) { }"

Fixes NDFDE
This commit is contained in:
Pavel V. Talanov
2016-03-01 20:03:35 +03:00
parent 363d545bd5
commit 1affb05b7b
6 changed files with 42 additions and 2 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -414,7 +414,7 @@ public class ControlStructureTypingVisitor extends ExpressionTypingVisitor {
}
else {
KtDestructuringDeclaration multiParameter = expression.getDestructuringParameter();
if (multiParameter != null && loopRange != null) {
if (multiParameter != null) {
KotlinType elementType = expectedParameterType == null ? ErrorUtils.createErrorType("Loop range has no type") : expectedParameterType;
TransientReceiver iteratorNextAsReceiver = new TransientReceiver(elementType);
components.annotationResolver.resolveAnnotationsWithArguments(loopScope, multiParameter.getModifierList(), context.trace);