Closed sschuberth closed 5 months ago
@sschuberth That seems weird. Did you use the @OptIn
annotation on the right element? It should mute the warning (the IDE is pretty good in suggesting it, but in some cases doesn't actually target the right context)
Ah, there were two things: First of all, I was mislead by the warning message saying
The declaration override should be annotated with '@nl.adaptivity.xmlutil.ExperimentalXmlUtilApi' or '@OptIn(nl.adaptivity.xmlutil.ExperimentalXmlUtilApi::class)'
So I used @ExperimentalXmlUtilApi
although it should have been @OptIn(ExperimentalXmlUtilApi::class)
. Secondly, I was indeed using the annotation on the override of the defaultOutputKind()
function whereas it should have been using it on the surrounding class that derives from DefaultXmlSerializationPolicy
.
Thanks for pointing me into the right direction!
Currently, the opt-in of
ExperimentalXmlUtilApi
results in a compiler warning sayingThis makes it hard for people with a
allWarningsAsErrors = true
compiler setting to take the experimental API into use. Isn't the fact to explicitly opt-in to*Experimental*XmlUtilApi
already enough of a sign that the user wants this, so the warning could be dropped?