diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-10-15 12:46:07 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-10-15 14:24:25 +0200 |
commit | 4ece62fba9ff4ea5e500a329ae2c349f91771ff8 (patch) | |
tree | d074dc6269376e173e94d9f50cdc448ddc0745cb /Zend/tests/bug80055.phpt | |
parent | ecd51aa099854a85585671947f053b69d5b73ceb (diff) | |
download | php-git-4ece62fba9ff4ea5e500a329ae2c349f91771ff8.tar.gz |
Fix bug #80055
We need to perform trait scope fixup for both methods involved
in the inheritance check. For that purpose we already need to
thread through a separate fn scope through the entire inheritance
checking machinery.
Diffstat (limited to 'Zend/tests/bug80055.phpt')
-rw-r--r-- | Zend/tests/bug80055.phpt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Zend/tests/bug80055.phpt b/Zend/tests/bug80055.phpt new file mode 100644 index 0000000000..f43ab490a3 --- /dev/null +++ b/Zend/tests/bug80055.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #80055: Abstract trait methods returning "self" cannot be fulfilled by traits +--FILE-- +<?php + +trait AbstractTrait { + abstract public function selfReturner(): self; +} + +trait ConcreteTrait { + public function selfReturner(): self { + return $this; + } +} + +class Test { + use AbstractTrait; + use ConcreteTrait; +} + +?> +===DONE=== +--EXPECT-- +===DONE=== |