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 when something isn't a number in a sequence operator in Rakudo #2323

Closed
p6rt opened this issue Jan 8, 2011 · 7 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Jan 8, 2011

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

Searchable as RT81974$

@p6rt
Copy link
Author

p6rt commented Jan 8, 2011

From @masak

<dwhipp> rakudo​: (0, {last if $^a==$^b; (1..5).pick} ... *).perl.say
<p6eval> rakudo e7e9d5​: OUTPUT«Method 'Bridge' not found for invocant
of class 'Failure' [...]
<dwhipp> LTA error :(
* masak submits rakudobug

The .Bridge method facilitates conversion between number types. It
should preferably not be user-visible at all. That it shows up here is
an indication of an error of some sort.

@p6rt
Copy link
Author

p6rt commented Dec 16, 2012

From @timo

Currently, rakudo handles this better, but in order to write a proper
test, more has to be done​:

(0, {last if $^a==$^b; (1..5).pick} ... *).perl.say
(ListIter.new(),).list
(0, {last if $^a==$^b; (1..5).pick} ... *).Array
Not enough positional parameters passed; got 1 but expected 2

< timotimo> I'm trying to write up a test that is sensible. when I do my
$fail = try { .say for (0, {last if $^a==$^b; (1..5).pick} ... *) }; I
get an X​::AdHoc for "not enough positional arguments". should I create a
new typed exception for positional argument count mismatch, throw it for
this error message and test for it to be returned?
< timotimo> alternatively, i could check is try { ... } ~~ X​::AdHoc, but
that doesn't seem right to me.
< timotimo> er, probably better to check against Exception
< FROGGS> checking against X​::AdHoc isnt ideal because you dont know
what exception it is
< jnthn> It'd be nice to have a typed exception here
< FROGGS> so, creating a new typed one and checking for that should be
the right
< jnthn> But it means twiddling C code to make it construct/throw one.
< jnthn> the signature binder is written in C :)
< jnthn> I think moritz and I had the idea of punting the real
construction to Perl 6, and just having a special hash of handlers
somewhere that we just invoke with arguments.

@p6rt
Copy link
Author

p6rt commented Dec 16, 2012

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

@p6rt
Copy link
Author

p6rt commented Feb 9, 2015

From @Mouq

The original meaning of this bug is actually a duplicate issue of #​76294, caused by the fact that Failure failed to either numify or give a decent error.

On Sun Dec 16 10​:24​:52 2012, timo wrote​:

Currently, rakudo handles this better, but in order to write a proper
test, more has to be done​:

(0, {last if $^a==$^b; (1..5).pick} ... *).perl.say
(ListIter.new(),).list
(0, {last if $^a==$^b; (1..5).pick} ... *).Array
Not enough positional parameters passed; got 1 but expected 2

< timotimo> I'm trying to write up a test that is sensible. when I do my
$fail = try { .say for (0, {last if $^a==$^b; (1..5).pick} ... *) }; I
get an X​::AdHoc for "not enough positional arguments". should I create a
new typed exception for positional argument count mismatch, throw it for
this error message and test for it to be returned?
< timotimo> alternatively, i could check is try { ... } ~~ X​::AdHoc, but
that doesn't seem right to me.
< timotimo> er, probably better to check against Exception
< FROGGS> checking against X​::AdHoc isnt ideal because you dont know
what exception it is
< jnthn> It'd be nice to have a typed exception here
< FROGGS> so, creating a new typed one and checking for that should be
the right
< jnthn> But it means twiddling C code to make it construct/throw one.
< jnthn> the signature binder is written in C :)
< jnthn> I think moritz and I had the idea of punting the real
construction to Perl 6, and just having a special hash of handlers
somewhere that we just invoke with arguments.

@p6rt
Copy link
Author

p6rt commented Apr 7, 2016

From @diakopter

resolved

12​:27 <diakopter> m​: (0, {last if $^a==$^b; (1..5).pick} ... *).perl.say
12​:27 <camelia> rakudo-moar 61d231​: OUTPUT«Cannot .elems a lazy list␤ in block <unit> at /tmp/s8pj85e1Wc line
  1␤␤Actually thrown at​:␤ in block <unit> at /tmp/s8pj85e1Wc line 1␤␤»

1 similar comment
@p6rt
Copy link
Author

p6rt commented Apr 7, 2016

From @diakopter

resolved

12​:27 <diakopter> m​: (0, {last if $^a==$^b; (1..5).pick} ... *).perl.say
12​:27 <camelia> rakudo-moar 61d231​: OUTPUT«Cannot .elems a lazy list␤ in block <unit> at /tmp/s8pj85e1Wc line
  1␤␤Actually thrown at​:␤ in block <unit> at /tmp/s8pj85e1Wc line 1␤␤»

@p6rt
Copy link
Author

p6rt commented Apr 7, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant