Skip to content

Support php 'never' type, change parsing of 'void' #374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 25, 2022

Conversation

TysonAndre
Copy link
Contributor

Similar to 'void', it's a compile time error to use void as a
parameter/property type, not a parse time error.
But static is a parse error.
(It can also be used in union types)

Remove redundant tokens added to merged returnTypeDeclarationTokens

Closes #373
Closes #372

@roblourens
Copy link
Member

There are no test cases that have to be changed as a result of the 'void' change? Should there be?

Similar to 'void', it's a compile time error to use void as a
parameter/property type, not a parse time error.
But `static` is a parse error.
(It can also be used in union types)

Remove redundant tokens added to merged returnTypeDeclarationTokens

Closes microsoft#373
Closes microsoft#372
@TysonAndre
Copy link
Contributor Author

I added a test that void/never are now allowed in parameter types. There weren't any before.

Aside: tests/cases/parser/staticReturnType2.php already tests that static is a parse error in parameter types (')' expected)

Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@roblourens roblourens merged commit 49058c4 into microsoft:main Aug 25, 2022
@TysonAndre TysonAndre deleted the support-never branch September 21, 2022 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants