Skip Menu |
Report information
Id: 127280
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: alex.jakimenko [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Date: Fri, 15 Jan 2016 21:18:00 +0200
Subject: LTA error message when using restricted args in list generator (2, 3, sub ($x where * > 5) {…} … 42)
From: Aleks-Daniel Jakimenko-Aleksejev <alex.jakimenko [...] gmail.com>
To: rakudobug [...] perl.org
Download (untitled) / with headers
text/plain 159b
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.


To: rakudobug [...] perl.org
From: Aleks-Daniel Jakimenko-Aleksejev <alex.jakimenko [...] gmail.com>
Subject: LTA error message when using arg constraints ( sub foo($x where * > 5) )
Date: Fri, 15 Jan 2016 21:31:44 +0200
Download (untitled) / with headers
text/plain 689b
This report is a continuation of https://rt.perl.org/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.
Download (untitled) / with headers
text/plain 166b
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 :-(
So there are three issues:

1) ✓ no line number. RESOLVED in https://github.com/rakudo/rakudo/commit/25e9fd76e85fabda20e263b6f87e27b0673f26e2
2) ✗ it could mention '* > 5'.
3) ✓ it could mention the 2. RESOLVED in https://github.com/rakudo/rakudo/commit/f1cd8e313abff2f66b9989fe60870a6e11cf7588

On 2016-01-15 12:15:53, bartolin@gmx.de wrote:
Show quoted text
> 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 :-(




This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org