Skip to content

Add leaf? distinction to TypeKind#4352

Merged
rmosolgo merged 3 commits intormosolgo:masterfrom
gmac:gmac/add_leaf_distinction
Feb 20, 2023
Merged

Add leaf? distinction to TypeKind#4352
rmosolgo merged 3 commits intormosolgo:masterfrom
gmac:gmac/add_leaf_distinction

Conversation

@gmac
Copy link
Contributor

@gmac gmac commented Feb 18, 2023

What

In this PR, I'd propose formalizing a proper leaf? distinction on TypeKind.

Why?

At present, TypeKind provides a fields? distinction (Object + Interface) that is a bit awkward because it slices across both Composite and Leaf distinctions...

  • fields? != Composite, because it omits Union.
  • !fields? != Leaf, because it includes Union, which is not a Leaf.

This ambiguity leads to awkward situations:

@rmosolgo rmosolgo added this to the 2.0.18 milestone Feb 20, 2023
@rmosolgo
Copy link
Owner

Thanks for the improvement! I agree this makes sense.

@rmosolgo rmosolgo merged commit d265f4a into rmosolgo:master Feb 20, 2023
@gmac gmac deleted the gmac/add_leaf_distinction branch February 20, 2023 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants