diff options
author | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | 2023-02-08 18:16:02 +0000 |
---|---|---|
committer | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | 2023-02-10 14:38:44 +0000 |
commit | d8b29a3430b219e3ab3dae2947a0ff22885c1b5e (patch) | |
tree | 61f97639111bca805999c24a256a2b0b037e9c98 /t/lib | |
parent | 07c4c053ee9ee2dac36d7eadd6d2558d94a7a802 (diff) | |
download | perl-d8b29a3430b219e3ab3dae2947a0ff22885c1b5e.tar.gz |
Field :param attributes, //= and ||= default assignments
Diffstat (limited to 't/lib')
-rw-r--r-- | t/lib/croak/class | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/lib/croak/class b/t/lib/croak/class index d1870930c8..48a744b511 100644 --- a/t/lib/croak/class +++ b/t/lib/croak/class @@ -106,3 +106,25 @@ class XXX { } EXPECT Can't "last" out of field initialiser expression at - line 5. +######## +use strict; +no warnings 'experimental::class'; +use feature 'class'; +class XXX { + field $x :param(p); + field $y :param(p); +} +EXPECT +Cannot assign :param(p) to field $y because that name is already in use at - line 6. +######## +use strict; +no warnings 'experimental::class'; +use feature 'class'; +class XXX { + field $x :param(p); +} +class YYY :isa(XXX) { + field $y :param(p); +} +EXPECT +Cannot assign :param(p) to field $y because that name is already in use at - line 8. |