Describe the bug
Mappie des not recognise if I provided a default for a nullable field when assigning to a non nullable field.
To Reproduce
Mapping:
to::createdAt fromExpression { it.createdAt ?: now() }
Exception
Target ToClass::createdAt of type LocalDateTime cannot be assigned from expression of type @FlexibleNullability LocalDateTime?
Operational workaround:
to::createdAt fromExpression { (it.createdAt ?: now()) as LocalDateTime }
Expected behavior
Mappie recognises if an expression's return value is not nullable
Kotlin version
2.2.10
Mappie version
2.2.10-1.4.2
Mappie and Kotlin compatibility
Is the Mappie version compatible with the Kotlin version?
Yes
Invocation method
The method of invocation, i.e. Gradle, Maven or CLI.
Gradle
Additional context
Add any other context about the problem here.
Describe the bug
Mappie des not recognise if I provided a default for a nullable field when assigning to a non nullable field.
To Reproduce
Mapping:
to::createdAt fromExpression { it.createdAt ?: now() }Exception
Operational workaround:
to::createdAt fromExpression { (it.createdAt ?: now()) as LocalDateTime }Expected behavior
Mappie recognises if an expression's return value is not nullable
Kotlin version
2.2.10
Mappie version
2.2.10-1.4.2
Mappie and Kotlin compatibility
Is the Mappie version compatible with the Kotlin version?
Yes
Invocation method
The method of invocation, i.e. Gradle, Maven or CLI.
Gradle
Additional context
Add any other context about the problem here.