From afa6110e6a57afa245038eb65e801f8d4611ae3a Mon Sep 17 00:00:00 2001 From: Natalia Selezneva Date: Tue, 15 May 2018 11:32:55 +0300 Subject: [PATCH] Minor: replace assert with user-friendly error --- .../kotlin/idea/scratch/compile/KtCompilingExecutor.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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") }