I'm having trouble with kotest's compiler assertio...
# kotest
j
I'm having trouble with kotest's compiler assertions module. I have a should-not-compile test that fails (the code in question supposedly compiles); however if I take that exact code and paste it next to the test case, the whole thing fails to compile. No idea how to troubleshoot this. (Screenshot 1: the test fails because the code compiles. Screenshot 2: the same code fails to actually compile.)
l
This looks like a Kotlin bug, the IDE itself doesn't recognize it's non-compilable
j
right, but in the actual compiler it fails; does kotest not run the same compiler my project compiles with?
intellij being spotty with type inference detection is not uncommon
l
I'm not sure. If we're using the same compiler as IntelliJ, they'll fail together. If we use the same as Kotlin it should fail. IIRC we use KotlinPoet, which probably uses compiler plugins which probably comes close to what IntelliJ does. Let me check on this details Anyways, I don't think this is an easy fix
We actually use com.tschuchort.compiletesting
I think it's probably a bug on their side rather than on Kotest side
j
ok, i'll upstream the issue then
hm, seems like that library is unmaintained, they have an open issue (with no maintainer activity) from july 2024 about supporting kotlin 2
so i assume that means that currently kotest compile tests compile using an old K1 compiler
which probably explains why the type inference is different
l
Hmm.. With that in mind we'll probably have to replace the library we are using
Would you mind creating a ticket to track this? Now it's definitely a bug on our side xD
j
can do
l
Thank you so much ❤️
s
I believe zac sweeners took over the libraryhttps://github.com/ZacSweers/kotlin-compile-testing
so we should just be able to bump to that