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

Array with pair written with the value implicitly True, [:a], won't evaluate (or .perl) properly in Rakudo #4280

Closed
p6rt opened this issue May 30, 2015 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented May 30, 2015

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

Searchable as RT125289$

@p6rt
Copy link
Author

p6rt commented May 30, 2015

From @masak

<zostay> m​: my %h = a => [a => 1], b => [b => 1, b => 2]; %h.perl.say;
%h.perl.EVAL;
<camelia> rakudo-moar c2a57e​: OUTPUT«{​:a([​:a(1)]), :b([​:b(1),
:b(2)])}<>␤Type check failed in binding op; expected 'Any' but got
'Mu' [...]
<lizmat> m​: {​:a([​:a(1)])} # shorter golf of zostay++ problem
<camelia> rakudo-moar c2a57e​: OUTPUT«Type check failed in binding op;
expected 'Any' but got 'Mu' [...]
<lizmat> m​: [​:a(1)] # even shorterer golf
<camelia> rakudo-moar c2a57e​: OUTPUT«Type check failed in binding op;
expected 'Any' but got 'Mu' [...]
<lizmat> zostay​: care to rakudobug this ? At least, the .perl output
should be fixed to allow roundtripping again
<lizmat> m​: [​:a] # shorterest golf
<camelia> rakudo-moar c2a57e​: OUTPUT«Type check failed in binding op;
expected 'Any' but got 'Mu' [...]
<lizmat> m​: [​:a,].perl.say # works
<camelia> rakudo-moar c2a57e​: OUTPUT«[​:a]␤»
<masak> I guess `[​:a]` should be an array of one Pair, too.
<lizmat> m​: [a=> 1].perl.say # that was the intent
<camelia> rakudo-moar c2a57e​: OUTPUT«[​:a(1)]␤»
<camelia> rakudo-moar c2a57e​: OUTPUT«[​:a(1)]␤»
<lizmat> m​: [a=> True].perl.say # closer to the thing
<camelia> rakudo-moar c2a57e​: OUTPUT«[​:a]␤»
<lizmat> m​: [a=> True].perl.EVAL # not roundtripping
<camelia> rakudo-moar c2a57e​: OUTPUT«Type check failed in binding op;
expected 'Any' but got 'Mu' [...]
<lizmat> m​: [(​:a)].perl.say # does work
<camelia> rakudo-moar c2a57e​: OUTPUT«[​:a]␤»
<masak> yeah, something is wrong there.
* masak submits rakudobug
<lizmat> note that the error occurs in from
src/gen/m-CORE.setting​:23160
(/Users/liz/Github/rakudo.moar/install/share/perl6/runtime/./CORE.setting.moarvm​:METAOP_REDUCE_LEFT​:17)
<lizmat> METAOP_REDUCE_LEFT ???
<masak> METAOP_REDUCE_LEFT could be because someone did [~] somewhere

@p6rt
Copy link
Author

p6rt commented May 30, 2015

From @zostay

This explodes​:

% perl6 -e "[a => 1].perl.EVAL"
Type check failed in binding op; expected 'Any' but got 'Mu'
  in block <unit> at EVAL_0​:1
  in any <unit-outer> at EVAL_0​:1

It should not.

--
Andrew Sterling Hanenkamp
sterling@​hanenkamp.com
785.370.4454

@p6rt
Copy link
Author

p6rt commented May 31, 2015

From @masak

Fixed (37e2c9), spectested (c2effba).

Resolving ticket.

@p6rt
Copy link
Author

p6rt commented May 31, 2015

@masak - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed May 31, 2015
@p6rt
Copy link
Author

p6rt commented May 31, 2015

From @lizmat

This was fixed earlier today by masak++ with 37e2c9c0cc6160aae8 . The problem was really that​:

  [​:a]

was being interpreted like a reduce meta operator like in​:

  [+] 1,2,3,4

The [​:a] representation is used by .perl on a Pair.

Liz

On 30 May 2015, at 19​:07, hanenkamp (via RT) <perl6-bugs-followup@​perl.org> wrote​:

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

This explodes​:

% perl6 -e "[a => 1].perl.EVAL"
Type check failed in binding op; expected 'Any' but got 'Mu'
in block <unit> at EVAL_0​:1
in any <unit-outer> at EVAL_0​:1

It should not.

--
Andrew Sterling Hanenkamp
sterling@​hanenkamp.com
785.370.4454

@p6rt
Copy link
Author

p6rt commented May 31, 2015

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

@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