Skip to content

Commit

Permalink
An accessor on a bound attribute should not decont
Browse files Browse the repository at this point in the history
As there is no container anyway in that case, so just simply return
the attribute.
  • Loading branch information
lizmat committed Jan 19, 2020
1 parent 3f0dca4 commit d1cda84
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core.c/Attribute.pm6
Expand Up @@ -100,7 +100,9 @@ my class Attribute { # declared in BOOTSTRAP
# Get the compiler to generate us an accessor when possible.
elsif $compiler_services.DEFINITE {
$meth := $compiler_services.generate_accessor($meth_name,
$dcpkg, $name, $!type, self.rw ?? 1 !! 0);
$dcpkg, $name, $!type,
self.rw || self.is_bound ?? 1 !! 0
);
}

# No compiler services available, so do it as a closure.
Expand Down

0 comments on commit d1cda84

Please sign in to comment.