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

.gist for built-in Sub's prints bogus "uninitialized value $name" warning #3696

Closed
p6rt opened this issue Feb 20, 2015 · 4 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Feb 20, 2015

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

Searchable as RT123895$

@p6rt
Copy link
Author

p6rt commented Feb 20, 2015

From @smls

Calling .gist on the Sub objects on of built-in subroutines/operators, causes a strange warning to be printed (in Rakudo 2015.01-156-g5ba2c86 with MoarVM 2015.01-69-g5bbfd1a)​:

  > say &map.gist
  use of uninitialized value $name of type Any in string context in block <unit> at <unknown file>​:1
 
  sub map (Any |) { #`(Sub|44490920) ... }
  > say &postcircumfix​:<[ ]>.gist
  use of uninitialized value $name of type Any in string context in block <unit> at <unknown file>​:1
 
  sub postcircumfix​:<[ ]> (Any |) { #`(Sub|45073152) ... }

The problem does not occur with custom subs​:

  >say (sub foo {}).gist
  sub foo () { #`(Sub|56973008) ... }

@p6rt
Copy link
Author

p6rt commented Feb 23, 2015

From @Mouq

Fixed in Rakudo commit​:

commit bb3a3df1abe27ae53e8f299b579edfcd89710a76
Author​: Mouq <alexmoquin@​gmail.com>
Date​: Mon Feb 23 00​:35​:58 2015 -0500

  Don't warn when gisting &map, &grep, etc.; RT #​123895

  The issue was that these subs had signatures with an unnamed "|"
  parameter in them, and a check was never made to see if "|" or "\"
  parameters had names.

Tests added to S06-signature/introspection.t in Roast commit​:

commit 317b088b1920c6a90692de536a2f78cdb55ffdc7
Author​: Mouq <alexmoquin@​gmail.com>
Date​: Mon Feb 23 00​:58​:02 2015 -0500

  Add tests for RT #​123895

Closing as resolved :)

On Fri Feb 20 08​:10​:13 2015, smls75@​gmail.com wrote​:

Calling .gist on the Sub objects on of built-in subroutines/operators,
causes a strange warning to be printed (in Rakudo 2015.01-156-g5ba2c86
with MoarVM 2015.01-69-g5bbfd1a)​:

say &map.gist
use of uninitialized value $name of type Any in string context in
block <unit> at <unknown file>​:1

sub map (Any |) { #`(Sub|44490920) ... }

say &postcircumfix​:<[ ]>.gist
use of uninitialized value $name of type Any in string context in
block <unit> at <unknown file>​:1

sub postcircumfix​:<[ ]> (Any |) { #`(Sub|45073152) ... }

The problem does not occur with custom subs​:

say (sub foo {}).gist
sub foo () { #`(Sub|56973008) ... }

@p6rt
Copy link
Author

p6rt commented Feb 23, 2015

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

@p6rt
Copy link
Author

p6rt commented Feb 23, 2015

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

@p6rt p6rt closed this as completed Feb 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant