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

error message when using restricted args in list generator (2, 3, sub ($x where * > 5) {…} … 42) #5052

Open
p6rt opened this issue Jan 15, 2016 · 4 comments
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Jan 15, 2016

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

Searchable as RT127280$

@p6rt
Copy link
Author

p6rt commented Jan 15, 2016

From @AlexDaniel

Code​:
say 2, 3, sub ($x where * > 5, $y) { $y ** $x } � 729

Result​:
===SORRY!===
Constraint type check failed for parameter '$x'

There is no line number.

@p6rt
Copy link
Author

p6rt commented Jan 15, 2016

From @AlexDaniel

This report is a continuation of
https://rt-archive.perl.org/perl6/Ticket/Display.html?id=127280.

Code​:
sub foo($x where * > 5) { � };
foo(2)

Result​:
Constraint type check failed for parameter '$x'
  in sub foo at ./test.p6 line 2
  in block <unit> at ./test.p6 line 3

<TimToady> and it could mention '* > 5' if it wanted to get fancy
<TimToady> it could conceivably even mention the 2

Indeed, instead of trying to find what this constraint actually does I'd
much rather prefer to see it immediately. Not sure how hard would it be to
implement it but there's definitely room for more awesomeness.

Regarding the value of the parameter in the backtrace, there will be
another bug report for that.

@p6rt
Copy link
Author

p6rt commented Jan 15, 2016

From @usev6

Oops, I hit the "merge" button a bit too fast. Looks like the second thing was reported as a separate bug intentionally. Sorry, I don't know how to undo the merge :-(

@p6rt
Copy link
Author

p6rt commented Oct 5, 2017

From @AlexDaniel

So there are three issues​:

1) � no line number. RESOLVED in rakudo/rakudo@25e9fd7
2) � it could mention '* > 5'.
3) � it could mention the 2. RESOLVED in rakudo/rakudo@f1cd8e3

On 2016-01-15 12​:15​:53, bartolin@​gmx.de wrote​:

Oops, I hit the "merge" button a bit too fast. Looks like the second
thing was reported as a separate bug intentionally. Sorry, I don't
know how to undo the merge :-(

@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