From 91b6daeaccc558e9fab72ad0fdd56a43fc56acbb Mon Sep 17 00:00:00 2001 From: pyos Date: Thu, 23 Apr 2020 14:37:43 +0200 Subject: [PATCH] JVM: fix debug info for script file classes --- .../backend/src/org/jetbrains/kotlin/codegen/ScriptCodegen.kt | 1 + compiler/testData/repl/evaluationErrors.repl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ScriptCodegen.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/ScriptCodegen.kt index 06f31e72b3f..0db6225ffb8 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ScriptCodegen.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ScriptCodegen.kt @@ -51,6 +51,7 @@ class ScriptCodegen private constructor( typeMapper.mapSupertype(it.defaultType, null).internalName }.toTypedArray() ) + v.visitSource(scriptDeclaration.containingKtFile.name, null) AnnotationCodegen.forClass(v.visitor, this, state).genAnnotations(scriptDescriptor, null, null) } diff --git a/compiler/testData/repl/evaluationErrors.repl b/compiler/testData/repl/evaluationErrors.repl index 5eaa42b1ff8..643e06a9a2b 100644 --- a/compiler/testData/repl/evaluationErrors.repl +++ b/compiler/testData/repl/evaluationErrors.repl @@ -6,4 +6,4 @@ java.lang.Exception: hi there >>> fun bar(): Nothing = throw AssertionError() >>> bar() java.lang.AssertionError - at Line_3.bar(Unknown Source) + at Line_3.bar(Line_3.kts:1)