diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/scratch/compile/KtCompilingExecutor.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/scratch/compile/KtCompilingExecutor.kt index bded5c16bd9..c11bc39746c 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/scratch/compile/KtCompilingExecutor.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/scratch/compile/KtCompilingExecutor.kt @@ -55,9 +55,9 @@ class KtCompilingExecutor(file: ScratchFile) : ScratchExecutor(file) { handlers.forEach { it.onStart(file) } val module = file.getModule() ?: return error("Module should be selected") - val psiFile = file.getPsiFile() ?: return error("Couldn't find psiFile for current editor") + val psiFile = file.getPsiFile() as? KtFile ?: return error("Couldn't find KtFile for current editor") - if (!checkForErrors(psiFile as KtFile)) { + if (!checkForErrors(psiFile)) { return error("Compilation Error") }