mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-26 20:14:46 +01:00
Add never type
This should be recognized as Identifier instead of Name now.
This commit is contained in:
parent
e03d63cffb
commit
8eb194ea1f
@ -663,6 +663,7 @@ abstract class ParserAbstract implements Parser
|
||||
'null' => true,
|
||||
'false' => true,
|
||||
'mixed' => true,
|
||||
'never' => true,
|
||||
];
|
||||
|
||||
if (!$name->isUnqualified()) {
|
||||
|
23
test/code/parser/stmt/function/neverType.test
Normal file
23
test/code/parser/stmt/function/neverType.test
Normal file
@ -0,0 +1,23 @@
|
||||
Never type
|
||||
-----
|
||||
<?php
|
||||
function test(): never {}
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Stmt_Function(
|
||||
attrGroups: array(
|
||||
)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: test
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: Identifier(
|
||||
name: never
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
Loading…
Reference in New Issue
Block a user