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
Checks in 'where' blocks of subtypes building on subtypes are not run in the right order in Rakudo #2222
Comments
From @masak$ perl6 -e 'subset A of Parcel where { .elems > 5 }; subset B of A The warning comes from the fact that B's where block is called, when Note that this ticket is caused entirely by the issue in #78318... but |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in S12-subset/subtypes.t commit 98abe8e910d8782900204f085099f6bab906ea5c [subtypes.t] Test for RT #78322 Inline Patchdiff --git a/S12-subset/subtypes.t b/S12-subset/subtypes.t
index a88130b..f1db1a0 100644
--- a/S12-subset/subtypes.t
+++ b/S12-subset/subtypes.t
@@ -190,6 +190,39 @@ ok "x" !~~ NW1, 'subset declaration without where clause rejects wrong value';
is @*rt78318, <bug hunt>, 'code called when subtype built on subtype';
}
+# RT #78322
+{
+ my $*call1;
+ my $*call2;
+
+ $*call1 = 0;$*call2 = 0;
+
+ subset RT78322 of Int where { $*call1++; $^a == 78322 };
+ subset Bughunt of RT78322 where { $*call2++; ?1 };
+
+ $*call1 = 0;$*call2 = 0;
+ nok 22 ~~ RT78322, 'level one subset check is false';
+ is $*call1, 1, 'level one subset checked (should fail)';
+ is $*call2, 0, 'level two subset not checked';
+
+ #?rakudo 3 todo 'RT 78322'
+ $*call1 = 0;$*call2 = 0;
+ nok 22 ~~ Bughunt, 'overall subset check is false';
+ is $*call1, 1, 'level one subset checked (should fail)';
+ is $*call2, 0, 'level two subset not checked';
+
+ $*call1 = 0;$*call2 = 0;
+ ok 78322 ~~ RT78322, 'level one subset check is true';
+ is $*call1, 1, 'level one subset checked (should succeed)';
+ is $*call2, 0, 'level two subset not checked';
+
+ $*call1 = 0;$*call2 = 0;
+ ok 78322 ~~ Bughunt, 'overall subset check is true';
+ #?rakudo 2 todo 'RT 78322'
+ is $*call1, 1, 'level one subset checked (should succeed)';
+ is $*call2, 1, 'level two subset checked (should succeed)';
+}
+
done_testing;
# vim: ft=perl6 |
The RT System itself - Status changed from 'new' to 'open' |
From @jnthnOn Sun Oct 10 16:15:54 2010, masak wrote:
Fixed probably when nom landed, tests added to cover it are already /jnthn |
@jnthn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#78322 (status was 'resolved')
Searchable as RT78322$
The text was updated successfully, but these errors were encountered: