Skip to content
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

Subtype based on any(@array) always matches in Rakudo #2451

Closed
p6rt opened this issue Jul 24, 2011 · 5 comments
Closed

Subtype based on any(@array) always matches in Rakudo #2451

p6rt opened this issue Jul 24, 2011 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jul 24, 2011

Migrated from rt.perl.org#95500 (status was 'resolved')

Searchable as RT95500$

@p6rt
Copy link
Author

p6rt commented Jul 24, 2011

From @masak

<masak> I found a bug. :)
<masak> rakudo​: subset Foo of Str where any(<foo bar>); for <foo OH
NOES> { when Foo { say "$_ is a Foo" } } # this is fine
<p6eval> rakudo 922500​: OUTPUT«foo is a Foo␤»
<masak> rakudo​: my @​strings = <foo bar>; subset Foo of Str where
any(@​strings); for <foo OH NOES> { when Foo { say "$_ is a Foo" } } #
OH NOES
<p6eval> rakudo 922500​: OUTPUT«foo is a Foo␤OH is a Foo␤NOES is a Foo␤»
* masak submits rakudobug
<masak> rakudo​: my @​strings = <foo bar>; subset Foo of Str where { say
@​strings.perl; $_ ~~ any(@​strings) }; for <foo OH NOES> { when Foo {
say "$_ is a Foo" } }
<p6eval> rakudo 922500​: OUTPUT«Null PMC access in find_method('perl') [...]
<masak> ah; it's the ol' "scope has wrong outer" bug again.
<masak> I'll submit it anyway because the use case might be worth
having a test for. someone who finds the old ticket, if any, is free
to merge.

@p6rt
Copy link
Author

p6rt commented Sep 11, 2011

From @masak

On Sun Jul 24 02​:17​:20 2011, masak wrote​:

<masak> I found a bug. :)
<masak> rakudo​: subset Foo of Str where any(<foo bar>); for <foo OH
NOES> { when Foo { say "$_ is a Foo" } } # this is fine
<p6eval> rakudo 922500​: OUTPUT«foo is a Foo␤»
<masak> rakudo​: my @​strings = <foo bar>; subset Foo of Str where
any(@​strings); for <foo OH NOES> { when Foo { say "$_ is a Foo" } } #
OH NOES
<p6eval> rakudo 922500​: OUTPUT«foo is a Foo␤OH is a Foo␤NOES is a
Foo␤»
* masak submits rakudobug
<masak> rakudo​: my @​strings = <foo bar>; subset Foo of Str where { say
@​strings.perl; $_ ~~ any(@​strings) }; for <foo OH NOES> { when Foo {
say "$_ is a Foo" } }
<p6eval> rakudo 922500​: OUTPUT«Null PMC access in find_method('perl')
[...]
<masak> ah; it's the ol' "scope has wrong outer" bug again.
<masak> I'll submit it anyway because the use case might be worth
having a test for. someone who finds the old ticket, if any, is free
to merge.

<masak> rakudo​: my @​strings = <foo bar>; subset Foo of Str where { $_ ~~
any(@​strings) }; for <foo OH NOES> { when Foo { say "$_ is a Foo" } }
<p6eval> rakudo 3c6296​: OUTPUT«foo is a Foo␤»
<masak> \o/
* masak marks https://rt-archive.perl.org/perl6/Ticket/Display.html?id=95500 fixed
<masak> will simplify the crypt game a bit ;)

Just needs a test in roast -- if it doesn't already have one -- and then
this ticket can be closed.

@p6rt
Copy link
Author

p6rt commented Sep 11, 2011

@masak - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Sep 29, 2011

From @moritz

Now tested in t/spec/S02-types/subset.t

@p6rt
Copy link
Author

p6rt commented Sep 29, 2011

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Sep 29, 2011
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant