Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[S12-attributes/instance,S06-signature/code] Unfudge for niecza

  • Loading branch information...
commit 6755bea0467fdba5de2b9da9999dbc5c3fb76ac8 1 parent 9ebc638
@sorear sorear authored
Showing with 5 additions and 12 deletions.
  1. +0 −2  S06-signature/code.t
  2. +5 −10 S12-attributes/instance.t
View
2  S06-signature/code.t
@@ -22,11 +22,9 @@ tester(sub ($x) { $collector = 3 * $x });
ok $collector == 12, 'same with anonymous sub';
sub tester2(&my_sub) { 1 } #OK not used
-#?niecza todo
dies_ok {eval 'tester2(42)' }, "can't pass thing that doesn't do Callable";
sub not_returns_a_sub { 3 };
-#?niecza todo
dies_ok { eval 'tester2(not_returns_a_sub)' },
"can't pass thing that doesn't do Callable";
View
15 S12-attributes/instance.t
@@ -124,7 +124,6 @@ class Foo1 { has $.bar; };
# L<S12/Semantics of C<bless>/If you name an attribute as a parameter, that attribute is initialized directly, so>
-#?niecza skip "Unhandled parameter twigil !"
{
class Foo6 {
has $.bar is rw;
@@ -145,7 +144,6 @@ class Foo1 { has $.bar; };
# check that doing something in submethod BUILD works
-#?niecza skip "Unhandled parameter twigil !"
{
class Foo6a {
has $.bar is rw;
@@ -153,7 +151,7 @@ class Foo1 { has $.bar; };
has $!hidden;
submethod BUILD (:$!hidden, :$!bar = 10, :$!baz?) {
- $.baz = 5;
+ $!baz = 5;
}
method get_hidden() { $!hidden }
}
@@ -167,7 +165,6 @@ class Foo1 { has $.bar; };
}
# check that assignment in submethod BUILD works with a bare return, too
-#?niecza skip "Unhandled parameter twigil !"
{
class Foo6b {
has $.bar is rw;
@@ -201,7 +198,6 @@ is Foo7e.new.attr, 42, "default attribute value (1)";
}
# check that doing something in submethod BUILD works
-#?niecza skip "Unhandled parameter twigil !"
{
class Foo7 {
has $.bar is rw;
@@ -246,15 +242,14 @@ is Foo7e.new.attr, 42, "default attribute value (1)";
# check mixture of positional/named args to BUILD
-#?niecza skip 'Virtual call $.a may not be used on partially constructed object'
{
class Foo9 {
has $.a;
has $.b;
submethod BUILD($foo, :$bar) {
- $.a = $foo;
- $.b = $bar;
+ $!a = $foo;
+ $!b = $bar;
}
}
@@ -544,8 +539,8 @@ is Foo7e.new.attr, 42, "default attribute value (1)";
has $.s is rw;
has B $.b is rw;
submethod BUILD {
- $.b = B.new;
- $.s = $.b.t(1, 2, 3);
+ $!b = B.new;
+ $!s = $!b.t(1, 2, 3);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.