Skip to content

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