Hi all, I have an issue involving lambda/anonymous class compilation and I'm wondering if anyone knows a workaround. tl;dr is the file path of the anonymous class kotlinc produces is too long and the FileOutputStream used to write the classes to disk throws an exception. Happens on all kotlin 1.2 versions, I'm targeting the JVM.
Context: I've got some test classes with long class names and very long function names inside. These test functions work with a test DSL that uses lambdas, and when the lambdas are compiled the class name references the function they're called from, so the resulting name is something like
ThisIsMyVeryLongClassName#given condition x y z and data a then expect p$1$1$3
. In some cases these file names are too long and the java fs code throws an exception.
Shortening the test class/function names 'solves' it but I'd prefer to avoid that. Marking the DSL methods as inline causes the class names to be even longer than if they aren't inline.
@JvmName
has no effect.