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

Crash with Proxy as argument to native parameters #2137

Open
CurtTilmes opened this issue Jul 27, 2018 · 2 comments
Open

Crash with Proxy as argument to native parameters #2137

CurtTilmes opened this issue Jul 27, 2018 · 2 comments
Labels
native types anything related to signed or unsigned native ints, or num, or str

Comments

@CurtTilmes
Copy link
Contributor

The Problem

test.pl: multi MAIN('foo') {}; sub USAGE { print $*USAGE }

Expected Behavior

Usage:
  test.pl foo

Actual Behavior

Cannot auto-decontainerize argument
in sub USAGE at <tmp> line 1
 in block <unit> at <tmp> line 1
@zoffixznet
Copy link
Contributor

Golfed to:

m: my $x := Proxy.new: :FETCH{"42\n"}, :STORE(-> $, $ {}); print $x
rakudo-moar 08b449e1a: OUTPUT: «Cannot auto-decontainerize argument␤ in block <unit> at <tmp> line 1␤␤»

Bisected to: 0d053ab

Fairly sure a strategic decont in IO::Handle.print will avoid the issue, but should it be fixed in a more robust way? Like whatever does the auto-decont to learn how to decont Proxy stuff?

@zoffixznet
Copy link
Contributor

zoffixznet commented Jul 27, 2018

I think this golfier golf answers my question:

m: -> str { }( Proxy.new: :FETCH{"42\n"}, :STORE(-> $, $ {}) )
rakudo-moar 08b449e1a: OUTPUT: «Cannot auto-decontainerize argument␤  in block <unit> at <tmp> line 1␤␤»

m: -> int { }( Proxy.new: :FETCH{42}, :STORE(-> | {}) )
rakudo-moar 08b449e1a: OUTPUT: «Cannot auto-decontainerize argument␤  in block <unit> at <tmp> line 1␤␤»

@zoffixznet zoffixznet changed the title Cannot auto-decontainerize $*USAGE Proxy doesn't play well with native parameters Jul 27, 2018
@zoffixznet zoffixznet changed the title Proxy doesn't play well with native parameters Crash with Proxy as argument to native parameters Jul 27, 2018
@lucasbuchala lucasbuchala added the native types anything related to signed or unsigned native ints, or num, or str label Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
native types anything related to signed or unsigned native ints, or num, or str
Projects
None yet
Development

No branches or pull requests

3 participants