Skip to content
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

kotlin typealias not work in property converter #1197

Open
1 task done
amoikevin opened this issue Nov 28, 2024 · 1 comment
Open
1 task done

kotlin typealias not work in property converter #1197

amoikevin opened this issue Nov 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@amoikevin
Copy link

amoikevin commented Nov 28, 2024

Is there an existing issue?

Build info

  • ObjectBox version: [4.0.3]
  • OS: [Android ]
  • Device/ABI/architecture: [arm64-v8a ]

Steps to reproduce

file A.kt:

class A {
     @Convert(converter = BConverter::class, dbType = String::class)
     var b:B?=null
}

class B {
     class Converter...
}

typealias BConverter = B.Converter

Expected behavior

generated ACursor.java:

...
import apple.ios.watches.model.BConverter;
...
private final BConverter bConverter = new BConverter();
...

Actual behavior

generated ACursor.java:

...
import apple.ios.watches.model.B.Converter;
...
private final Converter bConverter = new Converter();
...

Code

Code

Logs, stack traces

Logs
@amoikevin amoikevin added the bug Something isn't working label Nov 28, 2024
@greenrobot-team
Copy link
Member

greenrobot-team commented Dec 2, 2024

Thanks for reporting!

This currently can not be fixed as the ObjectBox Java generator generates Java code and:

Java has no concept of "type aliases" and can't see them

https://github.com/Kotlin/KEEP/blob/master/proposals/type-aliases.md#use-cases

For anyone else affected or interested, it helps us prioritize issues if you thumbs up the first post (GitHub can sort issues by thumbs ups)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants