Navigation Menu

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

“cannot stringify this” error message if the signature is incorrect ( sub foo(@array ($first, @rest)) ) #5682

Closed
p6rt opened this issue Sep 19, 2016 · 4 comments
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Sep 19, 2016

Migrated from rt.perl.org#129306 (status was 'resolved')

Searchable as RT129306$

@p6rt
Copy link
Author

p6rt commented Sep 19, 2016

From @AlexDaniel

Code​:
sub foo(@​array ($first, @​rest)) { say @​rest };
foo <1 2 3>

Result​:
cannot stringify this
  in sub foo at -e line 1
  in block <unit> at -e line 2

“cannot stringify this” error message is coming from MoarVM. This should not happen, right?

Anyway, it is definitely LTA and could be improved.

@p6rt
Copy link
Author

p6rt commented Sep 21, 2016

From @jnthn

On Sun Sep 18 17​:09​:21 2016, alex.jakimenko@​gmail.com wrote​:

Code​:
sub foo(@​array ($first, @​rest)) { say @​rest };
foo <1 2 3>

Result​:
cannot stringify this
in sub foo at -e line 1
in block <unit> at -e line 2

�cannot stringify this� error message is coming from MoarVM. This should not
happen, right?

Anyway, it is definitely LTA and could be improved.

Yeah, was a badass umption in the signature binder's error handling code. Fixed and now it more helpfully reports​:

$ ./perl6-m -e 'sub foo(@​array ($first, @​rest)) { say @​rest }; foo <1 2 3>;'Type check failed in binding to @​rest; expected Positional but got IntStr (IntStr.new(2, "2"))
  in sub foo at -e line 1
  in block <unit> at -e line 1

Added a test in S32-exceptions/misc.t.

@p6rt
Copy link
Author

p6rt commented Sep 21, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Sep 21, 2016

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Sep 21, 2016
@p6rt p6rt added the LTA Less Than Awesome; typically an error message that could be better label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better
Projects
None yet
Development

No branches or pull requests

1 participant