-
-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Describe the bug
When defining two mappers, the first one is defined explicitly and overrides the map function, and the second one uses the first one implicitly, if those two mappers are defined in different files and I modify the second mapper, then I get a compilation error.
To Reproduce
Full example here: https://github.com/thomaslhostis/mappie-compile-issue
Two data classes:
class Range(
val startsOn: java.time.LocalDate,
val endsOn: java.time.LocalDate,
)
class RangeResource(
val startsOn: kotlinx.datetime.LocalDate,
val endsOn: kotlinx.datetime.LocalDate,
)First mapper (JavaToKotlinLocalDateMapper.kt):
object JavaToKotlinLocalDateMapper : ObjectMappie<java.time.LocalDate, kotlinx.datetime.LocalDate>() {
override fun map(from: java.time.LocalDate) = from.toKotlinLocalDate()
}Second mapper (RangeMapper.kt):
object RangeMapper : ObjectMappie<Range, RangeResource>()When I modify the file RangeMapper.kt without modifying JavaToKotlinLocalDateMapper.kt, I get a compilation error. If I modify the file JavaToKotlinLocalDateMapper.kt after RangeMapper.kt, I don't get any error.
Expected behavior
Should compile no matter the order of modification of the files.
Kotlin version
2.2.0
Mappie version
1.4.1
Mappie and Kotlin compatibility
Yes
Invocation method
Gradle