[jOOQ/jOOQ#19281] Quantified comparison predicates produce illegal any[] cast when using Scala vararg splicing operators on generic typed sequences

This commit is contained in:
Lukas Eder 2025-10-24 12:17:55 +02:00
parent cdf00ca02f
commit 5c7a6f763b

View File

@ -174,6 +174,14 @@ final class Val<T> extends AbstractParam<T> implements UEmpty {
// Cannot use convertTo0() here as long as Param.setValue() is possible (mutable Params)
else if (OTHER.equals(getDataType()))
return new ConvertedVal<>(this, type);
// [#19281] A similar thing could happen with Object[] typed arrays, especially when passed to varargs methods,
// like DSL.any(T...). This is different from the above parser case.
else if (getDataType().isArray()
&& type.isArray()
&& OTHER.equals(getDataType().getArrayComponentDataType())
&& !OTHER.equals(type.getArrayComponentDataType()))
return convertTo0(type);
else
return (Val) this;
}