Fix for KT-9364: M13 Wrong compiler error for "unable to inline function"
#KT-9364 Fixed
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user