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

leaking NQPMu when coercion failed #4992

Closed
gfldex opened this issue Jul 20, 2022 · 4 comments
Closed

leaking NQPMu when coercion failed #4992

gfldex opened this issue Jul 20, 2022 · 4 comments

Comments

@gfldex
Copy link
Contributor

gfldex commented Jul 20, 2022

class A {

}

class C {
    has A() $.attr is required;
}

my $c4 = C.new: attr => 42;

output:

Impossible coercion from 'Int' into 'A': method new returned a type object NQPMu
  in block <unit> at /home/dex/projects/raku/rakudobug/tmp.raku line 9

As vrurg stated on Reddit, NQPMu should not leak into user-land.

Environment

  • Operating system: Linux dexhome 5.15.0-2-amd64 cc1: error: unrecognized command line option "-Wjump-missed-init" #1 SMP Debian 5.15.5-1 (2021-11-26) x86_64 GNU/Linux
  • Compiler version (perl6 -v or raku -v): Welcome to Rakudo™ v2022.06-33-g6dc2f92c9. Implementing the Raku® Programming Language v6.d. Built on MoarVM version 2022.06-2-gcc49dcf93.
@vrurg
Copy link
Member

vrurg commented Jul 25, 2022

It looks like the bug has been fixed somewhere along the way of implementing new-disp version of coercion. Could you, please, check it out with the latest master?

@vrurg
Copy link
Member

vrurg commented Aug 6, 2022

Closing as not reproducible on the master anymore.

@vrurg vrurg closed this as completed Aug 6, 2022
@melezhik
Copy link

How to check this? My r3 test still shows the error message on the latest commit - https://gistcdn.githack.com/melezhik/eae4aef3bd23eec25ddb2cb80635fe45/raw/372c833d42ea60c5a1d222dc8277b45997fb3bbc/report.html

@vrurg
Copy link
Member

vrurg commented Aug 16, 2022

That error is expected because Int is not coercible into A. The original problem was about the error message in which NQPMu was leaking. Now it produces correct error because there is no method.

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

3 participants