https://kotlinlang.org logo
Title
e

eygraber

07/05/2022, 7:07 PM
Updating to 1.2.0-alpha01-dev741 from dev-731 results in a crash when compiling:
java.lang.IncompatibleClassChangeError: Found interface org.jetbrains.kotlin.ir.types.IrSimpleType, but class was expected
	at androidx.compose.compiler.plugins.kotlin.analysis.StabilityInferencer.stabilityOf(Stability.kt:420)
	at androidx.compose.compiler.plugins.kotlin.analysis.StabilityInferencer.stabilityOf$default(Stability.kt:383)
	at androidx.compose.compiler.plugins.kotlin.lower.AbstractComposeLowering.stabilityOf(AbstractComposeLowering.kt:178)
😢 2
l

Lucas

07/05/2022, 7:13 PM
Same here
e

eddie

07/05/2022, 7:36 PM
@eygraber did you update to Kotlin 1.7?
m

Mitchell Syer

07/05/2022, 7:40 PM
Based on the branch the workflow ran on, doesnt seem like it. Still on 1.6.21
l

Lucas

07/05/2022, 7:41 PM
Should that be mandatory tho?
m

Mitchell Syer

07/05/2022, 7:41 PM
It is mandatory, the compose gradle plugin has always had specific versions of Kotlin it relies on
l

Landry Norris

07/05/2022, 7:43 PM
Also, 1.7 is Kotlin’s version of a ‘breaking change’. You can’t guarantee compatibility with 1.6.x
l

Lucas

07/05/2022, 7:43 PM
I see. The problem for me is that when i upgrade to kotlin 1.7 i get
<http://com.android.tools.r8.internal.nc|com.android.tools.r8.internal.nc>: Sealed classes are not supported as program classes
Stackoverflow suggests this should be corrected on agp 7.1, but i'm using 7.2.1 and still get this error This with java 17, didnt try with java 11
Java 11 works
:tnx: 2
e

eygraber

07/05/2022, 9:06 PM
Just updated the branch to use Kotlin 1.7 and it works. Missed the release note about 1.7 support.
k

Kirill Grouchnikov

07/07/2022, 2:47 PM
This whole situation with 1.2 alpha / rc drops and Kotlin 1.6.21 / 1.7.0 is messy
💯 1
l

Landry Norris

07/07/2022, 2:48 PM
Yeah. And there’s extra confusion for those of us on compose-jb, where the version is still 1.2.0-alpha01-devxxx, but different versions can use different 1.2.0 alphas. It gets a bit difficult to tell what version of Compose I’m actually using.
k

Kirill Grouchnikov

07/07/2022, 2:49 PM
I just upgraded Aurora to dev741 and 1.7.0. Seems to be fine
l

Landry Norris

07/07/2022, 2:50 PM
Yeah. 741 brought in 1.7 support. I guess that means it uses the stable compose compiler.
k

Kirill Grouchnikov

07/07/2022, 2:50 PM
This one was unexpected though. The compiler told me that the
when
conditions are not exhaustive
l

Lucas

07/07/2022, 2:51 PM
We cant blame the compose team, those are alpha versions after all
l

Landry Norris

07/07/2022, 2:51 PM
Yes. I believe that’s required in Kotlin 1.7
k

Kirill Grouchnikov

07/07/2022, 2:51 PM
But the
enum
has only two values
l

Landry Norris

07/07/2022, 2:51 PM
Interesting. Maybe a compiler bug?
I’d assume the alpha status of compose-jb is referring to iOS/macOS support? I know those are still experimental. It’s just a little confusing that the versions are similar (1.2.0 pre-releases), but don’t match the underlying compose.
k

Kirill Grouchnikov

07/07/2022, 2:53 PM
Yeah, probably. Didn't feel like I wanted to dive deep into it
l

Landry Norris

07/07/2022, 2:54 PM
Yeah. I always add an
else -> error("Case is not handed $whenParameter")
if it tells me I need an else.
l

Lucas

07/07/2022, 2:55 PM
Yeah, and CfW Canvas also. But still, its an alpha version so i guess things like that should be acceptable.
Not the exaustive when tho, that doesnt seem compose related
l

Landry Norris

07/07/2022, 2:56 PM
I thought CfW canvas is out of experimental as of a few months ago. Is it in some beta state right now?
Yeah. That’s a Kotlin 1.7 change.
But if he’s handling both enums, that should pick up as exhaustive.
l

Lucas

07/07/2022, 2:57 PM
It kinda works. Not sure about the official status tho. Textfields are still buggy (cant handle backspaces basically), but you could make some simple app work
I'm developing an android app (a food marketplace) and i'm hoping i'm going to be able to make it work on web with canvas in a couple months, even if still in alpha or beta.
my exaustive test enum works tho
k

Kirill Grouchnikov

07/07/2022, 3:32 PM
This is the only place in Aurora that I had to add that extra
else
. All the others are fine.
l

Landry Norris

07/07/2022, 3:33 PM
The enum isn’t open, right? I’m wondering if it thinks there’s a way for a module to add another option.
Is separatorOrientation nullable?
l

Lucas

07/07/2022, 3:33 PM
yeah nullability could be the problem
k

Kirill Grouchnikov

07/07/2022, 3:33 PM
Yes, nullable
l

Lucas

07/07/2022, 3:33 PM
then the null option is missing
l

Landry Norris

07/07/2022, 3:34 PM
That’s why. That makes null a valid path.
k

Kirill Grouchnikov

07/07/2022, 3:34 PM
Eek, I guess so
l

Landry Norris

07/07/2022, 3:34 PM
1.7 requires that all when are exhaustive. Nullable whens should handle this case explicitly.
k

Kirill Grouchnikov

07/07/2022, 3:35 PM
I might be able to make it non-nullable though. Looks like I always set it 🙂