but this doesn’t work seamlessly with other top-level elements in the file
s
spand
12/18/2019, 9:00 AM
Doesnt this work ?
Copy code
@file:Deprecated()
package org.foo
t
tseisel
12/18/2019, 10:54 AM
Unfortunately, the
Deprecated
annotation cannot target a file.
To me, it makes more sense to deprecate individual declarations from that file rather than the whole utility class visible from Java, as deprecations will not be visible from Kotlin.
👍 1
s
spand
12/18/2019, 11:40 AM
It did compile when using the java Deprecated annotation
j
jameswald
12/18/2019, 6:07 PM
Interesting, I see
@JvmName
has
AnnotationTarget.FILE
but
@Deprecated
doesn’t
jameswald
12/18/2019, 6:08 PM
At least not in K 1.3.60
jameswald
12/18/2019, 6:13 PM
Good point about deprecations not appearing in Kotlin source. In some cases that might be intentional, but at least in the situation I’m dealing with, deprecating the relevant elements gets the job done.