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 mentions parameter “$slip” (1.map: { Slip }) #4851

Closed
p6rt opened this issue Dec 12, 2015 · 8 comments
Closed

error message mentions parameter “$slip” (1.map: { Slip }) #4851

p6rt opened this issue Dec 12, 2015 · 8 comments
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Dec 12, 2015

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

Searchable as RT126883$

@p6rt
Copy link
Author

p6rt commented Dec 12, 2015

From @AlexDaniel

Code​:
say 1.map​: { Slip }

Result​:
Parameter '$slip' requires an instance of type Slip, but a type object was
passed. Did you forget a .new?
  in block <unit> at -e​:1

The problem is that it mentions some internal �$slip� parameter.

In this simple case it is pretty clear what is happening, but imagine the
type object coming from somewhere else. Perhaps there is a way to make the
error message slightly better?

@p6rt
Copy link
Author

p6rt commented Dec 12, 2015

From @LLFourn

2¢
I don't think this should be an error. A Slip type is a kinda odd thing to
be mapping but it should work.

quick look​:

https://github.com/rakudo/rakudo/blob/a61bbddc005d0188e2409a9ef8feee0c9551ab08/src/core/Any-iterable-methods.pm#L121

It just checks whether it's a Slip type but should also be checking that
it's defined.

On Sat, Dec 12, 2015 at 2​:30 PM Alex Jakimenko <perl6-bugs-followup@​perl.org>
wrote​:

# New Ticket Created by Alex Jakimenko
# Please include the string​: [perl #​126883]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=126883 >

Code​:
say 1.map​: { Slip }

Result​:
Parameter '$slip' requires an instance of type Slip, but a type object was
passed. Did you forget a .new?
in block <unit> at -e​:1

The problem is that it mentions some internal �$slip� parameter.

In this simple case it is pretty clear what is happening, but imagine the
type object coming from somewhere else. Perhaps there is a way to make the
error message slightly better?

@p6rt
Copy link
Author

p6rt commented Dec 12, 2015

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

@p6rt
Copy link
Author

p6rt commented Dec 12, 2015

From @geekosaur

On Fri, Dec 11, 2015 at 11​:55 PM, Lloyd Fournier <lloyd.fourn@​gmail.com>
wrote​:

I don't think this should be an error. A Slip type is a kinda odd thing to
be mapping but it should work.

It's not mapping over Slips in general; it's mapping over an *undefined*
Slip. I'd similarly expect some kind of error or at least warning for
mapping over an undefined list.

--
brandon s allbery kf8nh sine nomine associates
allbery.b@​gmail.com ballbery@​sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

@p6rt
Copy link
Author

p6rt commented Dec 12, 2015

From @LLFourn

yep by Slip type I meant a Slip type object ie undefined Slip (as opposed
to a Slip instance).

I don't really understand why it should be an error or warning.

1.map​: { Any } # ((Any))
1.map​: { Slip } # shouldn't this be ((Slip)), What's wrong with this?

On Sat, Dec 12, 2015 at 4​:00 PM Brandon Allbery <allbery.b@​gmail.com> wrote​:

On Fri, Dec 11, 2015 at 11​:55 PM, Lloyd Fournier <lloyd.fourn@​gmail.com>
wrote​:

I don't think this should be an error. A Slip type is a kinda odd thing
to be mapping but it should work.

It's not mapping over Slips in general; it's mapping over an *undefined*
Slip. I'd similarly expect some kind of error or at least warning for
mapping over an undefined list.

--
brandon s allbery kf8nh sine nomine
associates
allbery.b@​gmail.com
ballbery@​sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad
http://sinenomine.net

@p6rt
Copy link
Author

p6rt commented Dec 13, 2015

From @LLFourn

test​:
Raku/roast@c205f71

On Sat, Dec 12, 2015 at 8​:13 PM Elizabeth Mattijsen <liz@​dijkmat.nl> wrote​:

Fixed with 502b886e8d14dbd51b5 , needs tests

$ 6 'say 1.map​: { Slip }'
((Slip))

On 12 Dec 2015, at 03​:30, Alex Jakimenko (via RT) <
perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Alex Jakimenko
# Please include the string​: [perl #​126883]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=126883 >

Code​:
say 1.map​: { Slip }

Result​:
Parameter '$slip' requires an instance of type Slip, but a type object
was
passed. Did you forget a .new?
in block <unit> at -e​:1

The problem is that it mentions some internal �$slip� parameter.

In this simple case it is pretty clear what is happening, but imagine the
type object coming from somewhere else. Perhaps there is a way to make
the
error message slightly better?

@p6rt
Copy link
Author

p6rt commented Oct 5, 2017

From @AlexDaniel

This was fixed in rakudo/rakudo@502b886

Not sure why it's still not closed. Closing.

On 2015-12-12 20​:45​:06, lloyd.fourn@​gmail.com wrote​:

test​:
Raku/roast@c205f71

On Sat, Dec 12, 2015 at 8​:13 PM Elizabeth Mattijsen <liz@​dijkmat.nl>
wrote​:

Fixed with 502b886e8d14dbd51b5 , needs tests

$ 6 'say 1.map​: { Slip }'
((Slip))

On 12 Dec 2015, at 03​:30, Alex Jakimenko (via RT) <
perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Alex Jakimenko
# Please include the string​: [perl #​126883]
# in the subject line of all future correspondence about this
issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=126883 >

Code​:
say 1.map​: { Slip }

Result​:
Parameter '$slip' requires an instance of type Slip, but a type
object
was
passed. Did you forget a .new?
in block <unit> at -e​:1

The problem is that it mentions some internal “$slip” parameter.

In this simple case it is pretty clear what is happening, but
imagine the
type object coming from somewhere else. Perhaps there is a way to
make
the
error message slightly better?

@p6rt
Copy link
Author

p6rt commented Oct 5, 2017

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

@p6rt p6rt closed this as completed Oct 5, 2017
@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