New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
smartmatch fail in some compositions #803
Comments
From daniel@ruoso.comrole Foo {}; say SigType ~~ Foo; # this was supposed to be true but it is returning false in both... daniel |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S14-roles/composition.t commit 2968c8e7f200768949d786c46e0e094d95dec82d [t/spec] Test for RT #64002 Inline Patchdiff --git a/t/spec/S14-roles/composition.t b/t/spec/S14-roles/composition.t
index 85235ae..57798e7 100644
--- a/t/spec/S14-roles/composition.t
+++ b/t/spec/S14-roles/composition.t
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 11;
+plan 19;
# L<S14/Roles/"Roles may be composed into a class at compile time">
@@ -48,6 +48,18 @@ is $y.mA2, 'mA2', 'Can call mixed in method (two roles) 2';
is $y.mB1, 'mB1', 'Can call mixed in method (two roles) 3';
is $y.mB2, 'mB2', 'Can call mixed in method (two roles) 4';
+ok C2 ~~ rA, 'class matches first role';
+ok C2 ~~ rB, 'class matches second role';
+ok rA !~~ C2, 'first role does not match class';
+ok rB !~~ C2, 'second role does not match class';
+
+role RT64002 does rA does rB {}
+#?rakudo 2 todo 'RT #64002'
+ok RT64002 ~~ rA, 'role matches first role it does';
+ok RT64002 ~~ rB, 'role matches second role it does';
+ok rA !~~ RT64002, 'role not matched by first role it does';
+ok rB !~~ RT64002, 'role not matched by second role it does';
+
{
class D1 does rA {
method mA1 { |
The RT System itself - Status changed from 'new' to 'open' |
From @masakThis be Rakudo db84bc, running on Parrot r43174. $ perl6 -e 'class A {}; say A.new ~~ A' $ perl6 -e 'class A {}; say A.new !~~ A' $ perl6 -e 'role A {}; class B does A {}; say B.new ~~ A' $ perl6 -e 'role A {}; class B does A {}; say B.new !~~ A' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S03-operators/smartmatch.t commit 1547137afde1072821951f94e003ecbfa5364748 [t/spec] Test for RT 72048: !~~ of role on instance is always true Inline Patchdiff --git a/t/spec/S03-operators/smartmatch.t b/t/spec/S03-operators/smartmatch.t
index 5daa44c..7c6189e 100644
--- a/t/spec/S03-operators/smartmatch.t
+++ b/t/spec/S03-operators/smartmatch.t
@@ -353,7 +353,7 @@ my %hash5 = ( "foo" => 1, "bar" => 1, "gorch" => Mu, "baz" => Mu );
ok (Chihuahua ~~ Dog), "chihuahua isa dog";
ok (Something ~~ SomeRole), 'something does dog';
ok !(Chihuahua ~~ Cat), "chihuahua is not a cat";
-};
+}
# TODO:
# Signature Signature
@@ -471,6 +471,16 @@ eval_lives_ok 'class A { method foo { return "" ~~ * } }; A.new.foo',
}
+# RT 72048
+{
+ role RT72048_role {}
+ class RT72048_class does RT72048_role {}
+
+ ok RT72048_class.new ~~ RT72048_role, 'class instance matches role';
+ #?rakudo todo 'RT 72048: !~~ of role on instance is always true'
+ nok RT72048_class.new !~~ RT72048_role, 'class instance !!matches role';
+}
+
done_testing();
# vim: ft=perl6 |
The RT System itself - Status changed from 'new' to 'open' |
From @moritzThe test (now in S03-smartmatch/disorganized.t) passes, so I'm closing |
@moritz - Status changed from 'open' to 'resolved' |
@pmichaud - Status changed from 'resolved' to 'open' |
From @pmichaudThe bug resurfaces after the merge of the closure branch, so reopening Pm |
From @moritzTests pass again, closing ticket again. |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#64002 (status was 'resolved')
Searchable as RT64002$
The text was updated successfully, but these errors were encountered: