Skip to content

Commit

Permalink
Merge pull request #24 from xp-framework/feature/never-return
Browse files Browse the repository at this point in the history
Add support for `never` return type
  • Loading branch information
thekid authored Apr 25, 2021
2 parents 81b9340 + 39fa36a commit d5de121
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/php/lang/ast/Scope.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Scope {
'mixed' => true,
'array' => true,
'void' => true,
'never' => true,
'resource' => true,
'callable' => true,
'iterable' => true,
Expand Down
1 change: 1 addition & 0 deletions src/main/php/lang/ast/syntax/PHP.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,7 @@ private function type0($parse, $optional) {
'mixed' => true,
'array' => true,
'void' => true,
'never' => true,
'resource' => true,
'callable' => true,
'iterable' => true,
Expand Down
2 changes: 1 addition & 1 deletion src/test/php/lang/ast/unittest/TypeTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function parse($t) {
;
}

#[Test, Values(['string', 'int', 'bool', 'mixed', 'float', 'array', 'object', 'resource', 'iterable', 'callable', 'double'])]
#[Test, Values(['string', 'int', 'bool', 'mixed', 'float', 'array', 'object', 'resource', 'iterable', 'callable', 'double', 'void', 'never'])]
public function literals($t) {
Assert::equals(new IsLiteral($t), $this->parse($t));
}
Expand Down

0 comments on commit d5de121

Please sign in to comment.