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 $a parameter of op signature: ++.++ #4607

Closed
p6rt opened this issue Sep 29, 2015 · 6 comments
Closed

error message mentions $a parameter of op signature: ++.++ #4607

p6rt opened this issue Sep 29, 2015 · 6 comments
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Sep 29, 2015

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

Searchable as RT126220$

@p6rt
Copy link
Author

p6rt commented Sep 29, 2015

From @AlexDaniel

Code​:
++.++

Result​:
Parameter '$a' expected a writable container, but got Int value
  in block <unit> at ./test2.pl​:2

There is no $a in user code, so it should not be mentioned.

“$a” is mentioned because​:
.say for &postfix​:<++>.candidates

Result​:
sub postfix​:<++> (Mu​:D $a is rw) { #`(Sub|169376128) ... }
sub postfix​:<++> (Mu​:U $a is rw) { #`(Sub|169376224) ... }
sub postfix​:<++> (Bool​:U $a is rw) { #`(Sub|169375744) ... }
sub postfix​:<++> (Int​:D $a is rw) { #`(Sub|169375840) ... }
sub postfix​:<++> (int $a is rw) { #`(Sub|169375552) ... }
sub postfix​:<++> (Num​:D $a is rw) { #`(Sub|169375936) ... }
sub postfix​:<++> (Num​:U $a is rw) { #`(Sub|169376032) ... }
sub postfix​:<++> (num $a is rw) { #`(Sub|169375648) ... }

<FROGGS> AlexDaniel​: imagine you have a $a near that bit of code and waste
hours :o)

Indeed!

Same thing with -- and possibly other ops.

Perhaps there is some universal solution that will fix other problems like
this?

<jnthn> What is a bit bothersome is that we don't report that we're *in*
CORE.setting
<jnthn> So the backtrace makes it look like it could be in your own code
<FROGGS> jnthn​: don't we hide that information on purpose?
<jnthn> FROGGS​: Yeah, 'cus in other times it's annoying to do otherwise :P
<jnthn> Can't win! :)

@p6rt
Copy link
Author

p6rt commented Jun 19, 2016

From @zoffixznet

The error is pretty good now. Perhaps, the ticket can be closed?

zoffix@​VirtualBox​:~$ perl6 -e '++.++'
Cannot resolve caller prefix​:<++>(Int); none of these signatures match​:
  (Mu​:D $a is rw)
  (Mu​:U $a is rw)
  (Int​:D $a is rw)
  (int $a is rw)
  (Bool $a is rw)
  (Num​:D $a is rw)
  (Num​:U $a is rw)
  (num $a is rw)
  in block <unit> at -e line 1

zoffix@​VirtualBox​:~$

@p6rt
Copy link
Author

p6rt commented Jun 19, 2016

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

@p6rt
Copy link
Author

p6rt commented Jun 20, 2016

From @AlexDaniel

On Sun Jun 19 16​:56​:55 2016, cpan@​zoffix.com wrote​:

The error is pretty good now. Perhaps, the ticket can be closed?

zoffix@​VirtualBox​:~$ perl6 -e '++.++'
Cannot resolve caller prefix​:<++>(Int); none of these signatures match​:
(Mu​:D $a is rw)
(Mu​:U $a is rw)
(Int​:D $a is rw)
(int $a is rw)
(Bool $a is rw)
(Num​:D $a is rw)
(Num​:U $a is rw)
(num $a is rw)
in block <unit> at -e line 1

zoffix@​VirtualBox​:~$

It looks like behavior changed before Christmas.

Perhaps a tests or two for ++.++ is not going to hurt?

@p6rt
Copy link
Author

p6rt commented Aug 8, 2016

From @zoffixznet

Tests added in Raku/roast@4e973da24d

@p6rt
Copy link
Author

p6rt commented Aug 8, 2016

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

@p6rt p6rt closed this as completed Aug 8, 2016
@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