Skip to content

CAT 016

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-016 — Large union types

Severity: info | Confidence: medium | Auto-fix:

Description

Large union types — Large union types (e.g., 10+ types) generate slow dispatch code. Consider using a hierarchy or reducing variants.

Bad code

alias Many = Int32 | String | Float64 | Symbol | Nil | Bool | Char | Array(Int32) | Hash(String, Int32) | Tuple(Int32, Int32)

Benchmark

Note

See bench results at bench/cat-016/

Clone this wiki locally