8000 Using hyphens in naming is incorrect · Issue #2320 · google/ksp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Using hyphens in naming is incorrect #2320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yusefpasha opened this issue Feb 4, 2025 · 1 comment
Closed

Using hyphens in naming is incorrect #2320

yusefpasha opened this issue Feb 4, 2025 · 1 comment

Comments

@yusefpasha
Copy link
yusefpasha commented Feb 4, 2025

Description:
In a specific case, method names are being converted incorrectly. This issue has been observed in Room library. The problem was resolved in another way, but I think this error needs further investigation.
Using '-' in naming is incorrect:

  • original function name: updateDuration
  • converted function name: updateDuration-BRgCzHI

Error Message (Room 2.7.0-alpha13):

[ksp] java.lang.IllegalArgumentException: not a valid name: updateDuration-BRgCzHI
	at com.squareup.javapoet.Util.checkArgument(Util.java:53)
	at com.squareup.javapoet.MethodSpec$Builder.setName(MethodSpec.java:315)
	at com.squareup.javapoet.MethodSpec$Builder.<init>(MethodSpec.java:310)
	...

Error Message (Room 2.6.1):

[ksp] java.lang.IllegalArgumentException: List has more than one element.
	at kotlin.collections.CollectionsKt___CollectionsKt.single(_Collections.kt:618)
	at androidx.room.ext.Xelement_extKt.getValueClassUnderlyingProperty(xelement_ext.kt:35)
	at androidx.room.solver.TypeAdapterStore.createDefaultTypeAdapter(TypeAdapterStore.kt:383)
	at androidx.room.solver.TypeAdapterStore.findColumnTypeAdapter(TypeAdapterStore.kt:368)
	at androidx.room.processor.FieldProcessor.process(FieldProcessor.kt:63)
	at androidx.room.processor.PojoProcessor.doProcess(PojoProcessor.kt:173)
	...

Environment:

  • Android Studio Version: 2.24.2.2
  • Kotlin Version: 2.1.10
  • Room Version: 2.7.0-alpha13
  • Gradle Version: 8.12
  • KSP Version: 2.1.10-1.0.29
@yusefpasha yusefpasha changed the title KSP Error, Room for android Using hyphens in naming is incorrect Feb 4, 2025
@danysantiago
Copy link
Member

This is a Room issue and not specific to KSP: https://issuetracker.google.com/388299754

You can validate the fix using snapshot versions, see https://androidx.dev

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

No branches or pull requests

2 participants
0