Skip to content

[compiler] add basic support for type-checked mixed union types#734

Open
quasilyte wants to merge 1 commit intomasterfrom
quasilyte/restricted_mixed
Open

[compiler] add basic support for type-checked mixed union types#734
quasilyte wants to merge 1 commit intomasterfrom
quasilyte/restricted_mixed

Conversation

@quasilyte
Copy link
Contributor

Types like int|string can now be expressed in the type system. Every mixed union variant sets a bit flag inside TypeData.

When generating the C++ code, any mixed unions become simple mixed types.

Right now we only check function parameters passing and field assignments. Mixed union types are washed away in all contexts except for the phpdoc. We'll remove this restriction later, when more code will be ready to adapt for this change.

Types like `int|string` can now be expressed in the type system.
Every mixed union variant sets a bit flag inside TypeData.

When generating the C++ code, any mixed unions become simple mixed types.

Right now we only check function parameters passing and field assignments.
Mixed union types are washed away in all contexts except for the phpdoc.
We'll remove this restriction later, when more code will be ready to
adapt for this change.
@tolk-vm tolk-vm added the enhancement New feature or request label Feb 2, 2023
@Tsygankov-Slava Tsygankov-Slava mentioned this pull request Jul 3, 2023
44 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants