From 0364dd3aef3dc38708d89f5e9198099908ea0f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Wed, 9 Nov 2022 22:24:28 +0100 Subject: [PATCH] Add test for the never keyword --- specs/func-declaration/global.php | 12 ++++++++++++ specs/func-declaration/method.php | 8 ++++++++ specs/func-declaration/namespace.php | 12 ++++++++++++ 3 files changed, 32 insertions(+) diff --git a/specs/func-declaration/global.php b/specs/func-declaration/global.php index 6e63568b..f3febdfa 100644 --- a/specs/func-declaration/global.php +++ b/specs/func-declaration/global.php @@ -284,6 +284,9 @@ class Y {} use ArrayIterator; function foo(): void {} + function foo(): self {} + function foo(): static {} + function foo(): never {} function foo(): bool {} function foo(): ?bool {} @@ -347,6 +350,15 @@ class Y function foo() : void { } + function foo() : self + { + } + function foo() : static + { + } + function foo() : never + { + } function foo() : bool { } diff --git a/specs/func-declaration/method.php b/specs/func-declaration/method.php index 37e2e1e9..d0666b23 100644 --- a/specs/func-declaration/method.php +++ b/specs/func-declaration/method.php @@ -150,6 +150,8 @@ class Y {} class Main { function foo(): self {} function foo(): void {} + function foo(): static {} + function foo(): never {} function foo(): bool {} function foo(): ?bool {} @@ -219,6 +221,12 @@ function foo() : self function foo() : void { } + function foo() : static + { + } + function foo() : never + { + } function foo() : bool { } diff --git a/specs/func-declaration/namespace.php b/specs/func-declaration/namespace.php index b443ac43..fa96861f 100644 --- a/specs/func-declaration/namespace.php +++ b/specs/func-declaration/namespace.php @@ -438,6 +438,9 @@ class Y {} use ArrayIterator; function foo(): void {} + function foo(): self {} + function foo(): static {} + function foo(): never {} function foo(): bool {} function foo(): ?bool {} @@ -501,6 +504,15 @@ class Y function foo() : void { } + function foo() : self + { + } + function foo() : static + { + } + function foo() : never + { + } function foo() : bool { }