Fix for KT-9364: M13 Wrong compiler error for "unable to inline function"

#KT-9364 Fixed
This commit is contained in:
Michael Bogdanov
2015-10-22 15:28:35 +03:00
parent a7b3c70d21
commit d5126213d3
10 changed files with 93 additions and 0 deletions
@@ -16,6 +16,7 @@
package org.jetbrains.kotlin.resolve.calls.checkers;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
@@ -114,6 +115,18 @@ class InlineChecker implements CallChecker {
}
}
if (parent != null) {
//UGLY HACK
//check there is no casts
PsiElement current = expression;
while (current != parent) {
if (current instanceof KtBinaryExpressionWithTypeRHS) {
return false;
}
current = current.getParent();
}
}
return parent != null;
}