-
-
Save pierre-vigier/528d032218649a47266c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
use Test; | |
use AttrX::PrivateAccessor; | |
... | |
eval-lives-ok q[ | |
use AttrX::PrivateAccessor; | |
class Duplicate { | |
has $!private is providing-private-accessor; | |
method !private() { | |
"Just need a private method"; | |
} | |
} | |
}], "Collide as a private method with the same name already exists"; | |
Without use AttrX::PrivateAccessor; of line 8: | |
# Failed test 'Collide as a private method with the same name already exists' | |
# at t/020-basic.t line 27 | |
# Error: Can't use unknown trait 'is providing-private-accessor' in an attribute declaration. | |
# Looks like you failed 1 test of 3 | |
with the use: | |
# Failed test 'Collide as a private method with the same name already exists' | |
# at t/020-basic.t line 27 | |
# Error: Private method 'private' already declared in package Test::Duplicate | |
# Looks like you failed 1 test of 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment