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

"Cannot unbox a type object (Any) to a str." with $^var and [⊎] #5860

Closed
p6rt opened this issue Dec 5, 2016 · 4 comments
Closed

"Cannot unbox a type object (Any) to a str." with $^var and [⊎] #5860

p6rt opened this issue Dec 5, 2016 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 5, 2016

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

Searchable as RT130271$

@p6rt
Copy link
Author

p6rt commented Dec 5, 2016

From @zoffixznet

This code crashes with "Cannot unbox a type object (Any) to a str".

The problem goes away, if I change $^stuff to $_ or to $^stuff.List or to |$^stuff

  my $materials = bag flat 'wood' xx 300, 'glass' xx 100, 'brick' xx 3000;

  my @​wanted =
  bag(flat 'wood' xx 200, 'glass' xx 50, 'brick' xx 3000) but "house",
  bag(flat 'wood' xx 100, 'glass' xx 50) but "shed",
  bag( 'wood' xx 50) but "dog-house";

  say 'I can build...';
  .put for @​wanted.combinations.grep​: { $materials â�½ [â��] $^stuff };

@p6rt
Copy link
Author

p6rt commented Dec 5, 2016

From @zoffixznet

On Mon, 05 Dec 2016 12​:14​:05 -0800, cpan@​zoffix.com wrote​:

This code crashes with "Cannot unbox a type object (Any) to a str".

The problem goes away, if I change $^stuff to $_ or to $^stuff.List or
to |$^stuff

my $materials = bag flat 'wood' xx 300, 'glass' xx 100, 'brick' xx
3000;

my @​wanted =
bag(flat 'wood' xx 200, 'glass' xx 50, 'brick' xx 3000) but
"house",
bag(flat 'wood' xx 100, 'glass' xx 50) but
"shed",
bag( 'wood' xx 50) but "dog-
house";

say 'I can build...';
.put for @​wanted.combinations.grep​: { $materials â�½ [â��] $^stuff };

Golfed a bit more​:

[bag() but "house"].combinations.grep​: { [â��] $^stuff-we-want }

Any more thing I remove and the bug disappears.

@p6rt
Copy link
Author

p6rt commented Dec 12, 2016

From @zoffixznet

On Mon, 05 Dec 2016 12​:14​:05 -0800, cpan@​zoffix.com wrote​:

This code crashes with "Cannot unbox a type object (Any) to a str".

The problem goes away, if I change $^stuff to $_ or to $^stuff.List or
to |$^stuff

my $materials = bag flat 'wood' xx 300, 'glass' xx 100, 'brick' xx
3000;

my @​wanted =
bag(flat 'wood' xx 200, 'glass' xx 50, 'brick' xx 3000) but
"house",
bag(flat 'wood' xx 100, 'glass' xx 50) but
"shed",
bag( 'wood' xx 50) but "dog-
house";

say 'I can build...';
.put for @​wanted.combinations.grep​: { $materials â�½ [â��] $^stuff };

Thank you for the report. This is now fixed \o/

Fix​: rakudo/rakudo@9a161fa
Tests​: Raku/roast@ebfab26314

@p6rt p6rt closed this as completed Dec 12, 2016
@p6rt
Copy link
Author

p6rt commented Dec 12, 2016

@zoffixznet - Status changed from 'new' to 'resolved'

@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