Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix StaticType.flatten() on AnyOfType containing AnyType #1395

Merged
merged 2 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ Thank you to all who have contributed!
- The current SqlBlock, SqlDialect, and SqlLayout are marked as deprecated and will be slightly changed in the next release.

### Fixed
- `StaticType.flatten()` on an `AnyOfType` with `AnyType` will return `AnyType`
- Updates the default `.sql()` method to use a more efficient (internal) printer implementation.


### Removed

### Security
Expand All @@ -47,6 +49,7 @@ Thank you to all who have contributed!
Thank you to all who have contributed!
- @<your-username>
- @rchowell
- @alancai98

## [0.14.4]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ public data class AnyOfType(val types: Set<StaticType>, override val metas: Map<
types = this.types.flatMap {
when (it) {
is SingleType -> listOf(it)
is AnyType -> listOf(it)
is AnyType -> return@flatten it // if `AnyType`, return `AnyType`
is AnyOfType -> it.types
}
}.toSet()
Expand Down
Loading