JetBrains / Exposed

Kotlin SQL Framework
http://jetbrains.github.io/Exposed/
Apache License 2.0
8.28k stars 690 forks source link

refactor: Make call to `registerArgument` function type-safe in AllAnyFromArrayOp.kt #2015

Closed joc-a closed 7 months ago

joc-a commented 7 months ago

When calling the registerArgument function in the overriden registerSubSearchArgument function in AllAnyFromArrayOp, there is a type mismatch between sqlType and argument's type because there is a compile-time guarantee that ArrayColumnType only receives a value of type List and not Array. This mismatch results in a compilation error when trying to guarantee type-safety with the refactor of IColumnType. Therefore, this is a necessary preparation step for the refactor of IColumnType to make it and its subclasses type-safe.

To avoid introducing a breaking change, the functions anyFrom and allFrom in SQLExpressionBuilder.kt retain the same signature, but convert the Array to a List. In addition, these two functions were overloaded with ones that accept List instead of Array.