Skip to content

fix: Fix ClassCastException loading @JvmInline classes#123

Merged
travisMiehm merged 1 commit intomainfrom
travis/fix-classcastexception-inline-classes
Mar 22, 2026
Merged

fix: Fix ClassCastException loading @JvmInline classes#123
travisMiehm merged 1 commit intomainfrom
travis/fix-classcastexception-inline-classes

Conversation

@travisMiehm
Copy link
Contributor

In my project using KSP 2.2.20, I'm seeing ClassCastException when hibernate tries to convert a string to an inline class. My investigation with Claude suggests this is related to the newer KSP version, specifically that the new version does not include Modifier.VALUE in declaration.modifiers.

The fix is to also check for the @JvmInline annotation on the type.

I was able to verify this fixed the issue in my project by doing a local publish, and updating my project to use that local version.

Fix: KspSymbolExtensions.kt:isValueClass() now falls back to checking @JvmInline when Modifier.VALUE is absent (as happens
with KSP 2.2.20 for cross-module value classes).
@travisMiehm travisMiehm requested a review from luanpotter March 21, 2026 04:48
Copy link
Collaborator

@QuinnB73 QuinnB73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@travisMiehm travisMiehm changed the title Fix ClassCastException loading @JvmInline classes fix: Fix ClassCastException loading @JvmInline classes Mar 21, 2026
@travisMiehm travisMiehm merged commit 14e7086 into main Mar 22, 2026
7 of 8 checks passed
@travisMiehm travisMiehm deleted the travis/fix-classcastexception-inline-classes branch March 22, 2026 00:43

/**
* Test entity that uses a [PageNumber] field — a [@JvmInline value class][JvmInline] defined in
* the [yawn-api] module, which is a binary dependency of this module.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

glad we already had one for easy testing cross-modules!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants