You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a role is dynamically applied to instantiated object using does it breaks role-qualified calls to any previously applied roles.
Expected Behavior
self.Role1::method;
self does Role2;
self.Role1::method;
must pass without errors
Actual Behavior
In the above example second call to method would fail with No concretization found for Role1 error.
Steps to Reproduce
The following code demonstrates the bug:
role Foo1 { method foo { say "Foo1::foo"; } }
role Foo2 { method foo { say "Foo2::foo"; } }
role Foo3 { method foo { say "Foo3::foo"; } }
class Foo { method foo { say "Foo::foo"; } }
class Bar is Foo does Foo1 {
method foo {
say "Bar::foo";
self.Foo::foo;
self.Foo1::foo;
say "-- Do Foo2";
self does Foo2;
self.Foo::foo;
try {
self.Foo1::foo;
CATCH { default { say $_.message } }
}
self.Foo2::foo;
say "-- Do Foo3";
self does Foo3;
try {
self.Foo2::foo;
CATCH { default { say $_.message } }
}
self.Foo3::foo;
}
}
Bar.new.foo;
Being run it produces the output:
Bar::foo
Foo::foo
Foo1::foo
-- Do Foo2
Foo::foo
No concretization found for Foo1
Foo2::foo
-- Do Foo3
No concretization found for Foo2
Foo3::foo
Note that problem occurs with role-qualified calls only while class-qualified remain unaffected.
Environment
Operating system: macOS 10.13, Linux Mint 19
Compiler version (perl6 -v): This is Rakudo version 2018.08 built on MoarVM version 2018.08
2018.06 and 2017.10 are affected too.
The text was updated successfully, but these errors were encountered:
The Problem
When a role is dynamically applied to instantiated object using
doesit breaks role-qualified calls to any previously applied roles.Expected Behavior
must pass without errors
Actual Behavior
In the above example second call to
methodwould fail with No concretization found for Role1 error.Steps to Reproduce
The following code demonstrates the bug:
Being run it produces the output:
Note that problem occurs with role-qualified calls only while class-qualified remain unaffected.
Environment
perl6 -v): This is Rakudo version 2018.08 built on MoarVM version 2018.082018.06 and 2017.10 are affected too.
The text was updated successfully, but these errors were encountered: