Skip to content

Fix enum case conflict in trait binding#21771

Open
prateekbhujel wants to merge 1 commit intophp:masterfrom
prateekbhujel:prateekbhujel/fix-gh-21760-enum-trait-const-conflict
Open

Fix enum case conflict in trait binding#21771
prateekbhujel wants to merge 1 commit intophp:masterfrom
prateekbhujel:prateekbhujel/fix-gh-21760-enum-trait-const-conflict

Conversation

@prateekbhujel
Copy link
Copy Markdown
Contributor

Fixes #21760.

Trait constant binding currently assumes that an existing entry in the constants table is a normal class constant. If the existing entry is an enum case with the same name, that path crashes instead of rejecting the conflict cleanly.

Reject that conflict up front during trait constant binding and cover it with a regression test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trait with class constant name conflict against enum case causes SEGV

1 participant