From 5c7a6f763b04e3fdc9828337faec615b8bc4d578 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Fri, 24 Oct 2025 12:17:55 +0200 Subject: [PATCH] [jOOQ/jOOQ#19281] Quantified comparison predicates produce illegal any[] cast when using Scala vararg splicing operators on generic typed sequences --- jOOQ/src/main/java/org/jooq/impl/Val.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jOOQ/src/main/java/org/jooq/impl/Val.java b/jOOQ/src/main/java/org/jooq/impl/Val.java index 831c55fcd7..3ddec9ff36 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Val.java +++ b/jOOQ/src/main/java/org/jooq/impl/Val.java @@ -174,6 +174,14 @@ final class Val extends AbstractParam 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; }