Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix some uses of attributes where they cannot work

  • Loading branch information...
commit a685a147e669fd3bf50a955c5d6b0b931c074b2b 1 parent 4808a9d
Moritz Lenz moritz authored
2  S12-attributes/instance.t
View
@@ -502,7 +502,7 @@ is Foo7e.new.attr, 42, "default attribute value (1)";
class AttrInitTest {
has $.a = 1;
has $.b = 2;
- has $.c = $.a + $.b;
+ has $.c = $!a + $!b;
}
is AttrInitTest.new.c, 3, 'Can initialize one attribute based on another (1)';
is AttrInitTest.new(a => 2).c, 4, 'Can initialize one attribute based on another (2)';
13 S12-class/attributes.t
View
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 22;
+plan 21;
# L<S12/Fancy method calls/"For a call on your own private method">
@@ -107,19 +107,12 @@ is($bar.bar[2], 300, 'array attribute initialized/works');
}
# RT 81718
-#?niecza skip 'Poorly designed test? Niecza rejects the code at compile time...'
-{
+eval_dies_ok q[
class RT81718 {
has $.bughunt is rw;
sub bomb { "life is a $.bughunt" }
method meta_bomb { "the good " ~ bomb() }
}
-
- my $rt81718 = RT81718.new();
-
- dies_ok { $rt81718.bomb() }, 'no attribute access for sub';
- #?rakudo skip 'RT81718 (false positive in nom) (noauto)'
- dies_ok { $rt81718.meta_bomb() }, 'no attr access for sub from method';
-}
+], 'no attr access for sub inside class';
# vim: ft=perl6
2  integration/role-composition-vs-attribute.t
View
@@ -16,7 +16,7 @@ class S does B
$.t.x;
}
submethod BUILD(*@_)
- { $.t = T.new }
+ { $!t = T.new }
}
# uncomment below after the bug is fixed. As below line will cause infinite loop;
Please sign in to comment.
Something went wrong with that request. Please try again.