objectbox / objectbox/objectbox-java

kotlin typealias not work in property converter

Open
#1,197 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
4.6k
Forks
311
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the Kotlin example in A.kt and inspect the generated ACursor.java, especially its converter import and field declaration. Compare the generated output with the expected and actual snippets; the work is done when a typealias converter generates a usable converter reference instead of the nested Converter name.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.