You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
abstract class MigrationDbKotlin : RoomDatabase() {
internal abstract fun dao(): MigrationDao
}
Room needs to generate MigrationDbKotlin_Impl and override dao method but we need to rename it to the JVM name (because room generates java code). In this particular case, the name we need is dao$room_testapp_kotlin_debug(). I'm not sure how kotlin calculates it but seems like it is coming from the project setup.
Would be great to have an API to do this conversion.
The text was updated successfully, but these errors were encountered:
An interesting part is that, we do actually have a very similar method: mapToJvmSignature except it is just the signature, does not include the method name. (also doesn't support property getters/setters which could be added)
I'm wondering, maybe it makes sense to change that to return a class that will have the information in the asm method, that would also fix this functionality. One downside of it is of course it is more expensive to calculate the whole signature when you just need the name.
For internal methods fields etc, Kotlin renames the element during compilation.
This becomes a problem in Room where we need to override / implement an internal class/field/method and we don't know the exact name.
For instance, for the following code: full source
Room needs to generate
MigrationDbKotlin_Impl
and overridedao
method but we need to rename it to the JVM name (because room generates java code). In this particular case, the name we need isdao$room_testapp_kotlin_debug()
. I'm not sure how kotlin calculates it but seems like it is coming from the project setup.Would be great to have an API to do this conversion.
The text was updated successfully, but these errors were encountered: