diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c61a6ba71..a767879343 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ Thank you to all who have contributed! ### Added ### Changed +- Change `StaticType.AnyOfType`'s `.toString` to not perform `.flatten()` ### Deprecated @@ -165,6 +166,7 @@ Thank you to all who have contributed! ### Deprecated + ### Fixed - Fixes the CLI hanging on invalid queries. See issue #1230. - Fixes Timestamp Type parsing issue. Previously Timestamp Type would get parsed to a Time type. diff --git a/partiql-types/src/main/kotlin/org/partiql/types/StaticType.kt b/partiql-types/src/main/kotlin/org/partiql/types/StaticType.kt index d2ef1756f8..df77f42f6f 100644 --- a/partiql-types/src/main/kotlin/org/partiql/types/StaticType.kt +++ b/partiql-types/src/main/kotlin/org/partiql/types/StaticType.kt @@ -642,21 +642,10 @@ public data class AnyOfType(val types: Set, override val metas: Map< } } - override fun toString(): String = - when (val flattenedType = flatten()) { - is AnyOfType -> { - val unionedTypes = flattenedType.types - when (unionedTypes.size) { - 0 -> "\$null" - 1 -> unionedTypes.first().toString() - else -> { - val types = unionedTypes.joinToString { it.toString() } - "union($types)" - } - } - } - else -> flattenedType.toString() - } + override fun toString(): String { + val types = types.joinToString { it.toString() } + return "union($types)" + } override val allTypes: List get() = this.types.map { it.flatten() }