Skip to content

Commit

Permalink
Make sure we call .words on stringified var
Browse files Browse the repository at this point in the history
By taking out the call to Stringy in the infix:<~> handling, any variable
would be directly exposed to having ".words" called upon it in << >>
post-processing.  This works for IO::Paths, but doesn't work for many
other classes:

  $ perl6 -e 'class A {}; my $a = A.new; dd << foo $a >>'
  No such method 'words' for invocant of type 'A'

Fixed this by inserting a stringification for this particular case of
quotewords processing.  Fixes R#2203
  • Loading branch information
lizmat committed Aug 12, 2018
1 parent 229fa2c commit e5568aa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Perl6/Actions.nqp
Expand Up @@ -10509,7 +10509,11 @@ class Perl6::QActions is HLL::Actions does STDActions {
:op('callmethod'),
:name('words'),
:node($/),
$node,
QAST::Op.new(
:op('callmethod'),
:name('Stringy'),
$node
),
QAST::IVal.new( :value(1), :named('autoderef') )
)
)
Expand Down

0 comments on commit e5568aa

Please sign in to comment.