Skip to content

Fix #80596 - broken anonymous class union typehint errors - #6601

Closed
danog wants to merge 2 commits into
php:masterfrom
phabelio:master
Closed

Fix #80596 - broken anonymous class union typehint errors#6601
danog wants to merge 2 commits into
php:masterfrom
phabelio:master

Conversation

@danog

@danog danog commented Jan 13, 2021

Copy link
Copy Markdown
Contributor

@afilina

afilina commented Jan 13, 2021

Copy link
Copy Markdown
Contributor

Can we have a test to verify the bugfix? Example of a PR that fixes 2 bugs and has one test case for each: #6599

@danog

danog commented Jan 13, 2021

Copy link
Copy Markdown
Contributor Author

Sure, done!

@afilina

afilina commented Jan 13, 2021

Copy link
Copy Markdown
Contributor

LGTM.

For those wondering about expected behavior, self is supposed to be supported in union types as per the RFC (see under "Type grammar")

@php-pulls php-pulls closed this in f9fbba4 Jan 14, 2021
@nikic

nikic commented Jan 14, 2021

Copy link
Copy Markdown
Member

I've slightly adjusted the fix by moving the truncation into class name resolution, rather than type concatenation.

adrian-enspired pushed a commit to adrian-enspired/php-src that referenced this pull request Aug 4, 2026
Cut off part after null byte when resolving the class name, to
avoid cutting off a larger part lateron.

Closes phpGH-6601.
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.

3 participants