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
literals and boxed types do not get unboxed for native types in multies #5741
Comments
From zoffix@zoffix.comWe can use a literal numeral or an Int with a sub that takes a native: <Zoffix> m: sub foo (int) { say "OK!" }; foo 2 But, such auto-unboxing doesn't work if we use a multi instead: <Zoffix> m: multi foo (int) { say "OK!" }; foo 2 Even though auto-boxing for natives works regardless of whether we <Zoffix> m: sub foo (Int) { say "OK!" }; my int $x = 2; foo $x I found this bug while out on a hunt for another one, and it looks As part of this issue and the one I'm resolving, I had to write out a (I describe int/Int, but same applies for other natives that have 0) Literal: treat as Int my int $i = 2; # used in all examples to indicate native int multi foo (int $x) {say "native" }; multi foo (Int $x) {say "other Int" }; multi foo (int $x) {say "native" }; multi foo (Int $x) {say "other Int" }; multi foo (int $x) {say "native" }; multi foo (int $x) {say "native" }; multi foo (Int $x) {say "other Int" }; multi foo (int $x) {say "native" }; multi foo (int $x) {say "native" }; multi foo (int $x, int $y) {say "native" }; multi foo (int $x, int $y) {say "native" }; |
From @zoffixznetPer jnthn's comments this is not a bug: https://irclog.perlgeek.de/perl6-dev/2016-10-25#i_13462673 Will close after https://rt-archive.perl.org/perl6//Public/Bug/Display.html?id=128655 is sorted |
The link to the IRC logs doesn't work anymore. I think it would be this discussion (with some context further up): https://colabti.org/irclogger/irclogger_log/perl6-dev?date=2016-10-25#l164
Since that issue (which lives at #5460 now) is closed, I'll go ahead and close this one as well (as "Won't fix"). Please reopen, if you disagree. |
Migrated from rt.perl.org#129844 (status was 'new')
Searchable as RT129844$
The text was updated successfully, but these errors were encountered: