Toshihiro Nakamura
05/26/2024, 12:36 AMjava
property conflicts with java.time.OffsetDateTime
, resulting in an error message: Unresolved reference 'time'.
object MyObject {
val java: Boolean = true
val someTime: OffsetDateTime = java.time.OffsetDateTime.now()
}
I understand that this can be avoided in one of the following ways:
• Change the property name java
• Use import statements to avoid the fully qualified name
• Create an alias for java.time.LocalDateTime
and refer to it
Is there any other way to resolve this issue?
I am creating code generation tool, so I am looking for a solution that can be applied uniformly in all cases, rather than a workaround that is applied only under specific conditions.Toshihiro Nakamura
05/26/2024, 12:46 AMobject __MyObject {
val __java: Boolean = true
val __someTime: OffsetDateTime = java.time.OffsetDateTime.now()
}
object MyObject {
val java: Boolean = __MyObject.__java
val someTime: OffsetDateTime = __MyObject.__someTime
}
Do you have any comments on this?hho
05/26/2024, 1:16 AMobject MyObject {
val java: Boolean = true
val someTime: java.time.OffsetDateTime = `java.time`.OffsetDateTime.now()
}
Toshihiro Nakamura
05/26/2024, 1:36 AMKlitos Kyriacou
05/28/2024, 8:49 AM