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

.WHAT does not allow spaces around the dot (42 . WHAT) #4838

Open
p6rt opened this issue Dec 9, 2015 · 4 comments
Open

.WHAT does not allow spaces around the dot (42 . WHAT) #4838

p6rt opened this issue Dec 9, 2015 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 9, 2015

Migrated from rt.perl.org#126855 (status was 'open')

Searchable as RT126855$

@p6rt
Copy link
Author

p6rt commented Dec 9, 2015

From @AlexDaniel

Code​:
say 42 .WHAT

Result​:
===SORRY!===
Method call must either supply a name or have a child node that evaluates
to the name

Well, I think that it should work. One practical use is 「^42 .WHAT」.

Some explanation​:

<psch> well, .WHAT anywhere in a space-y method call chain didn't work with
  the original commit either
<psch> so it's at least not a regression
<AlexDaniel> okay, interesting
<psch> probably 'cause .WHAT doesn't go the normal
  QAST​::Op(​:op<callmethod>,...) route
<moritz> right, it's macro-Y
<psch> which fits the error message, 'cause we apparently build such an Op
but
  don't populate the children correctly, because .WHAT isn't a
method
  that can be called with callmethod

Well, if it is not supposed to work, then at least the error message should
be awesome. Right now it doesn't even mention the line number.

@p6rt
Copy link
Author

p6rt commented Jun 4, 2017

From @zoffixznet

On Wed, 09 Dec 2015 08​:12​:00 -0800, alex.jakimenko@​gmail.com wrote​:

Code​:
say 42 .WHAT

Result​:
===SORRY!===
Method call must either supply a name or have a child node that evaluates
to the name

Well, I think that it should work. One practical use is 「^42 .WHAT」.

Some explanation​:

<psch> well, .WHAT anywhere in a space-y method call chain didn't work with
the original commit either
<psch> so it's at least not a regression
<AlexDaniel> okay, interesting
<psch> probably 'cause .WHAT doesn't go the normal
QAST​::Op(​:op<callmethod>,...) route
<moritz> right, it's macro-Y
<psch> which fits the error message, 'cause we apparently build such an Op
but
don't populate the children correctly, because .WHAT isn't a
method
that can be called with callmethod

Well, if it is not supposed to work, then at least the error message should
be awesome. Right now it doesn't even mention the line number.

+1 on fixing this or improving error message.

In my production code I encountered this bug while trying to test the term's type object
and I added the space after the method to align stuff​:

  is make-temp-path.WHAT === IO​::Path, *.not, 'made path is not === IO​::Path';
  is make-temp-dir .WHAT === IO​::Path, *.not, 'made dir is not === IO​::Path';

The second line crashed.

The current error doesn't even include a location, so it has the potential for a tedious bug hunt.

@p6rt
Copy link
Author

p6rt commented Jun 4, 2017

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

@p6rt
Copy link
Author

p6rt commented Mar 13, 2018

From @zoffixznet

On Sun, 04 Jun 2017 11​:19​:57 -0700, cpan@​zoffix.com wrote​:

On Wed, 09 Dec 2015 08​:12​:00 -0800, alex.jakimenko@​gmail.com wrote​:

Code​:
say 42 .WHAT

Result​:
===SORRY!===
Method call must either supply a name or have a child node that
evaluates
to the name

Well, I think that it should work. One practical use is 「^42 .WHAT」.

Some explanation​:

<psch> well, .WHAT anywhere in a space-y method call chain didn't
work with
the original commit either
<psch> so it's at least not a regression
<AlexDaniel> okay, interesting
<psch> probably 'cause .WHAT doesn't go the normal
QAST​::Op(​:op<callmethod>,...) route
<moritz> right, it's macro-Y
<psch> which fits the error message, 'cause we apparently build such
an Op
but
don't populate the children correctly, because .WHAT
isn't a
method
that can be called with callmethod

Well, if it is not supposed to work, then at least the error message
should
be awesome. Right now it doesn't even mention the line number.

+1 on fixing this or improving error message.

In my production code I encountered this bug while trying to test the
term's type object
and I added the space after the method to align stuff​:

is make-temp-path.WHAT === IO​::Path, *.not, 'made path is not ===
IO​::Path';
is make-temp-dir .WHAT === IO​::Path, *.not, 'made dir is not ===
IO​::Path';

The second line crashed.

The current error doesn't even include a location, so it has the
potential for a tedious bug hunt.

Hit on this bug again. Even while knowing you can't put spaces before .WHAT, it took me a couple of minutes trying to find where this error was coming from.

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant