Skip to content

2022 08 15 concrete_type_def

Artem Pelenitsyn edited this page Mar 1, 2023 · 1 revision

Concrete Type Definition

Looking into upcoming changes in Julia 1.8 relevant to us, I am unsure how to deal with one thing regarding definition of concrete type. So far, I used to align with what code_warntype shows in red. Starting with 1.8 they want to stop painting in red small (< 4) unions of concrete types because the compiler optimizes them well, allegedly; the change is merged from this pull request. I don’t know a definitive reference for why small unions are fine (I seem to remember a discussion to that effect on their bug tracker but can’t find it now). But in any case, we need to decide, whether we want to stick to a more clear, textbook definition or if we want to mirror whatever they think is a good approximation.

To be fair, they don’t ignore such small unions completely, they paint them in yellow, which means something in between red (bad) and blue (good). They used to paint in yellow unions with Missing or Nothing, and I did adopt that behavior in that I didn’t flag such unions as unstable. So, I already use a more nuanced, implementation-dependent definition.