Skip to content

Commit ed4e6f0

Browse files
committed
[Compiler plugin] Interpreter catches exception thrown inside to report them as compilation errors. Add special constructor for errors that shouldn't be caught
1 parent b253e1c commit ed4e6f0

File tree

1 file changed

+5
-1
lines changed
  • plugins/kotlin-dataframe/src/org/jetbrains/kotlinx/dataframe/plugin

1 file changed

+5
-1
lines changed

plugins/kotlin-dataframe/src/org/jetbrains/kotlinx/dataframe/plugin/interpret.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fun <T> KotlinTypeFacade.interpret(
9191
val actualArgsMap = refinedArguments.associateBy { it.name.identifier }.toSortedMap()
9292
val conflictingKeys = additionalArguments.keys intersect actualArgsMap.keys
9393
if (conflictingKeys.isNotEmpty()) {
94-
error("Conflicting keys: $conflictingKeys")
94+
interpretationFrameworkError("Conflicting keys: $conflictingKeys")
9595
}
9696
val expectedArgsMap = processor.expectedArguments
9797
.filterNot { it.name.startsWith("typeArg") }
@@ -271,6 +271,10 @@ fun <T> KotlinTypeFacade.interpret(
271271
}
272272
}
273273

274+
fun interpretationFrameworkError(message: String): Nothing = throw InterpretationFrameworkError(message)
275+
276+
class InterpretationFrameworkError(message: String) : Error(message)
277+
274278
interface InterpretationErrorReporter {
275279
val errorReported: Boolean
276280
fun reportInterpretationError(call: FirFunctionCall, message: String)

0 commit comments

Comments
 (0)