Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix error for useless accessor generation.
  • Loading branch information
jnthn committed Jul 18, 2015
1 parent 48c0ba5 commit ca6cdb4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Perl6/Actions.nqp
Expand Up @@ -2563,7 +2563,7 @@ Compilation unit '$file' contained the following violations:
:method, :$invocant_type);
my $code := methodize_block($/, $*W.stub_code_object('Method'),
$a_past, $signature, %sig_info);
install_method($/, $meth_name, 'has', $code, $install_in);
install_method($/, $meth_name, 'has', $code, $install_in, :gen-accessor);
}

sub install_routine_symbol($block, $code) {
Expand Down Expand Up @@ -3252,7 +3252,7 @@ Compilation unit '$file' contained the following violations:
}

# Installs a method into the various places it needs to go.
sub install_method($/, $name, $scope, $code, $outer, :$private, :$meta) {
sub install_method($/, $name, $scope, $code, $outer, :$private, :$meta, :$gen-accessor) {
my $meta_meth;
if $private {
if $*MULTINESS { $/.PRECURSOR.panic("Private multi-methods are not supported"); }
Expand All @@ -3271,6 +3271,10 @@ Compilation unit '$file' contained the following violations:
if nqp::can($*PACKAGE.HOW, $meta_meth) {
$*W.pkg_add_method($/, $*PACKAGE, $meta_meth, $name, $code);
}
elsif $gen-accessor {
$/.PRECURSOR.worry("Useless generation of accessor method in " ~
($*PKGDECL || "mainline"));
}
else {
my $nocando := $*MULTINESS eq 'multi' ?? 'multi-method' !! 'method';
$/.PRECURSOR.worry(
Expand Down

0 comments on commit ca6cdb4

Please sign in to comment.