Does this seem like a bug to anyone else? In a Java library the annotations were just switched from jsr305 to jetbrains. There's a getter method defined like this:
/**
* Get the value of the OutputArguments Property, if it exists.
*
* @return the value of the OutputArguments Property, if it exists.
* @see MethodNodeProperties#OutputArguments
*/
@Nullable
public Argument[] getOutputArguments() {
return getProperty(MethodNodeProperties.OutputArguments).orElse(null);
}
Now in some Kotlin code that uses this library it is inferring the type to be
Array<Argument?>?
instead of
Array<Argument>?
as it did previously. So now what was once:
override fun getOutputArguments(): Array<Argument> = methodNode.outputArguments ?: emptyArray()
now won't compile unless it's changed to something like this:
override fun getOutputArguments(): Array<Argument> {
val outputArguments: Array<Argument>? =
methodNode.outputArguments as Array<Argument>?
return outputArguments ?: emptyArray()
}