Thanks @broot . Updated my post. However with your example, I’m getting a Kotlin internal compilation error: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Failed to generate expression: KtObjectLiteralExpression Caused by: java.lang.AssertionError: Non-outer parameter incorrectly mapped to outer for public constructor <no name provided>()
Is it a Gradle project? If so what is the version of Kotlin in build.gradle(.kts) file? I think by default Intellij doesn’t use a compiler provided by the IDE plugin, but by Gradle.