https://kotlinlang.org logo
#eap
Title
t

Thomas

08/05/2019, 7:06 PM
I’m currently trying out the new EAP for Kotlin 1.3.50. I wanted to use the new
Duration
in my project but keep getting the following compile error. I am unable to reproduce it in a new project when using
Duration
. Can anyone see what’s wrong?
This is the code what causes the error in my project:
Copy code
import kotlin.time.Duration
class DurationExample {
    var duration: Duration? = null
}
If I put this in a new project it works fine.
s

Sergey Chelombitko

08/05/2019, 8:33 PM
Did you annotate the class/file with
@UseExperimental(ExperimentalTime::class)
?
t

Thomas

08/05/2019, 8:35 PM
@Sergey Chelombitko I used the compiler argument. That made the experimental warning disappear
I tried adding the annotation as well but still the same compile error
d

Dico

08/05/2019, 11:52 PM
Try disabling kapt
i

ilya.gorbunov

08/06/2019, 1:08 AM
I've reproduced it in plain java class and filed as https://youtrack.jetbrains.com/issue/KT-33157
t

Thomas

08/06/2019, 8:18 AM
Great, thank you Ilya!
2 Views