Skip to content

Instantly share code, notes, and snippets.

@pierre-vigier
Created January 14, 2016 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pierre-vigier/528d032218649a47266c to your computer and use it in GitHub Desktop.
Save pierre-vigier/528d032218649a47266c to your computer and use it in GitHub Desktop.
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