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

Can't override class's Numeric #59

Open
coke opened this issue Oct 4, 2012 · 4 comments
Open

Can't override class's Numeric #59

coke opened this issue Oct 4, 2012 · 4 comments

Comments

@coke
Copy link
Contributor

coke commented Oct 4, 2012

20:23 < [Coke]> nqp: class EEK {method Numeric() {return 3}}; my $a:=
EEK.new(); say(+$a);
20:23 <+p6eval> nqp: OUTPUT«No applicable candidates found to dispatch to for
'Numeric'. Available candidates are:␤␤current instr.: 'Numeric'
pc 3450 (src/stage2/gen/NQPCORE.setting.pir:1608)
(src/stage2/NQPCORE.setting:171)␤»

20:29 < [Coke]> r: class EEK {method Numeric() {return 3}}; my $a:= EEK.new();
say(+$a);
20:29 <+p6eval> rakudo fb11f1: OUTPUT«3␤»

This is a (minor) blocker for partcl-nqp work.

@arnsholt
Copy link
Contributor

arnsholt commented Oct 6, 2013

Still happens on latest NQP.

@arnsholt
Copy link
Contributor

I've had another look at this. On JVM, it turns out the numify op looks for a method Num rather than Numeric. Changing that reveals another bug where it tries to unbox the int as a num, but if you also replace 3 with 3.0 it works on JVM at least.

Still not quite sure what's happening on Parrot.

@coke
Copy link
Contributor Author

coke commented Apr 24, 2020

Parrot's long gone, partcl isn't a thing anymore, but this is still not working:

09:05 < [Coke]> nqp: class EEK {method Numeric() {return 3}}; my $a:= EEK.new(); say(+$a);
09:05 < camelia> nqp-moarvm: OUTPUT: «Cannot intify this object of type P6opaque (EEK)␤   at <tmp>:1  (<ephemeral
                 file>:<mainline>)␤ from gen/moar/stage2/NQPHLL.nqp:1916
                 (/home/camelia/rakudo-m-inst-1/share/nqp/lib/NQPHLL.moarvm:eval)␤ from gen/moar/stage2/NQPHLL.nqp:2121
                 (/home/camelia/raku…»

@coke
Copy link
Contributor Author

coke commented Jan 26, 2022

Updated error text:

16:22 < [Coke]> nqp: class EEK {method Numeric() {return 3}}; my $a:= EEK.new(); say(+$a);
16:22 < camelia> nqp-moarvm: OUTPUT: «Cannot intify object of type EEK␤   at src/vm/moar/ModuleLoader.nqp:129
                 (/home/camelia/rakudo-m-inst-1/share/nqp/lib/ModuleLoader.moarvm:)␤ from <tmp>:1  (<ephemeral
                 file>:<mainline>)␤ from gen/moar/stage2/NQPHLL.nqp:1949  (/home/camelia/rakudo-m-inst-1/s…»

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants