Skip to content

Kotlin: Fix findTopLevelPropertyOrWarn for K2 compiler#21915

Open
david-allison wants to merge 1 commit into
github:mainfrom
david-allison:kotlin-dropped-class
Open

Kotlin: Fix findTopLevelPropertyOrWarn for K2 compiler#21915
david-allison wants to merge 1 commit into
github:mainfrom
david-allison:kotlin-dropped-class

Conversation

@david-allison
Copy link
Copy Markdown

@david-allison david-allison commented May 30, 2026

Note

Assisted-by: Claude Opus 4.8 - diagnostics & initial fix


Receiver::class.java resolves differently from K1:

  • K1: getJavaClass(KClass) - value argument
  • K2: KClass.<get-java>() - property receiver

This caused the lookup to fail, so Intent(context, Receiver::class.java) dropped the second argument.

"Couldn't find JVM intrinsic property kotlin.jvm java in kotlin.jvm.JvmClassMappingKt"

This caused false positives in java/android/implicit-pendingintents

`Receiver::class.java` resolves differently from K1:

K1: getJavaClass(KClass) - value argument
K2: KClass.<get-java>() - property receiver

This caused the lookup to fail, so
`Intent(context, Receiver::class.java)` dropped the second argument.

log:
"Couldn't find JVM intrinsic property kotlin.jvm java in kotlin.jvm.JvmClassMappingKt"

This caused false positives in `java/android/implicit-pendingintents`

The fix mirrors 5c36e63

Fixes github#20153
Assisted-by: Claude Opus 4.8 - diagnostics & initial fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive "use of implicit PendingIntents" alert

1 participant