diff options
author | Arne Johannessen <ajnn@cpan.org> | 2023-03-02 14:56:59 +0100 |
---|---|---|
committer | Paul Evans <leonerd@leonerd.org.uk> | 2023-03-02 16:27:02 +0000 |
commit | edcf480ecf5d1e197b42f41432d14000ddbdb2cc (patch) | |
tree | 0d09f1efb78f0d94ece3b6b57808b118fa8d3a41 /t | |
parent | 49830b9d6df254629bb26062f7477b3b371dd1d2 (diff) | |
download | perl-edcf480ecf5d1e197b42f41432d14000ddbdb2cc.tar.gz |
Allow :isa in class declaration without a block
Using class attributes in the unit class syntax was a syntax error. This change makes the following two lines equivalent:
class B :isa(A) ;
class B :isa(A) { }
Addresses GH issue #20888.
Diffstat (limited to 't')
-rw-r--r-- | t/class/inherit.t | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/t/class/inherit.t b/t/class/inherit.t index 03b2199683..9fd314b9f9 100644 --- a/t/class/inherit.t +++ b/t/class/inherit.t @@ -71,4 +71,14 @@ no warnings 'experimental::class'; is($obj->x, "X", 'Constructor params passed through to superclass'); } +{ + class Test4A { } + + class Test4B :isa(Test4A); + + package main; + my $obj = Test4B->new; + ok($obj isa Test4A, 'Unit class syntax allows :isa'); +} + done_testing; |