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

LTA error message for .^add_method redefinition #6224

Open
p6rt opened this issue May 6, 2017 · 1 comment
Open

LTA error message for .^add_method redefinition #6224

p6rt opened this issue May 6, 2017 · 1 comment
Labels

Comments

@p6rt
Copy link

p6rt commented May 6, 2017

Migrated from rt.perl.org#131262 (status was 'new')

Searchable as RT131262$

@p6rt
Copy link
Author

p6rt commented May 6, 2017

From trey@cpan.org

Given *RedefErr.pm6*​:

use v6.c;
unit class RedefErr;

method foo() { -4; }

method four() { IntStr.new(4, "four"); }

BEGIN { :​:?CLASS.^add_method('foo', :​:?CLASS.^method_table<four>) };

attempting to use the package gives the following compile-time error​:

$ perl --version
This is Rakudo version 2017.03-123-gcb27bce built on MoarVM version
2017.03-87-g5d73bf4
implementing Perl 6.c.
$ perl6 -MRedefErr
===SORRY!=== Error while compiling
/home/trey/src/HandlesBug/lib/RedefErr.pm6 (RedefErr)
An exception occurred while evaluating a BEGIN
at /home/trey/src/HandlesBug/lib/RedefErr.pm6 (RedefErr)​:8
Exception details​:
  ===SORRY!=== Error while compiling
  Package 'RedefErr' already has a method 'foo' (did you mean to
declare a multi-method?)
  at :

$

Note the message completes with at :.

It should give a more useful error message about where the redefinition
actually occurred.

@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