# New Ticket Created by  "brian d foy" 
# Please include the string:  [perl #131349]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=131349 >


.invert doesn't do what it says on the tin. From
https://docs.perl6.org/type/Pair#method_invert

    my Pair $p1 = (6 => 'Perl');
    say $p1.invert;                                   # OUTPUT: «Perl => 6␤»
    say $p1.invert.WHAT;                              # OUTPUT: «(Pair)␤»

    my Pair $p2 = ('Perl' => (5, 6));
    say $p2.invert;                                   # OUTPUT: «(5 =>
Perl 6 => Perl)␤»
    say $p2.invert.WHAT;                              # OUTPUT: «(List)␤»

    my Pair $p3 = ('Perl' => { cool => 'language'});
    say $p3.invert;                                   # OUTPUT: «{cool
=> language => Perl}␤»
    say $p3.invert.WHAT;                              # OUTPUT: «(Hash)␤»

I get sequences instead:

    (Perl => 6)
    (Seq)
    (5 => Perl 6 => Perl)
    (Seq)
    ((cool => language) => Perl)
    (Seq)

% perl6 -v
This is Rakudo version 2017.04.3 built on MoarVM version 2017.04-53-g66c6dda
implementing Perl 6.c.

Reply via email to