Zoffix++ pointed out that there is a problem with IntStr also:

Code:
enum Foo (:Bar(1), :Baz(<42>))

Result:
===SORRY!===
Incompatible MROs in P6opaque rebless for types IntStr and Foo

On 2017-10-07 17:16:30, alex.jakime...@gmail.com wrote:
> Actually, it's not about the error message. The whole thing can be
> golfed to
> this:
>
> enum Foo (:Bar(1), :Baz(True))
>
> And the error happens because:
>
> Code:
> use nqp;
> say so nqp::istype(True, Int);
> nqp::rebless(True, Int)
>
> Result:
> True
> Incompatible MROs in P6opaque rebless for types Bool and Int
> in block <unit> at -e line 3
>
> Or something like that. So it is “istype” of something but you can't
> rebless
> it.
>
> The type is checked here:
>
https://github.com/rakudo/rakudo/blob/de0533c4d4c9f425ce22432a8e4555ded27cba91/src/Perl6/Actions.nqp#L4621
>
> Rebless is here:
>
https://github.com/rakudo/rakudo/blob/5144216f6ea723747cb25fea51f99861c1ea213a/src/Perl6/World.nqp#L3629
>
> IRC logs:
> https://irclog.perlgeek.de/perl6/2017-10-07#i_15272313
> https://irclog.perlgeek.de/perl6/2017-10-08#i_15272350
>
> I really don't know what to do about it. You cannot just .Int it
> because
> stringy enums exist (enum Foo (:Bar("foo")); say Bar). It's weird.
>
> On 2016-07-10 07:01:59, c...@zoffix.com wrote:
> > Still present today on rakudo 89470a:
> >
> > <Zoffix> m: enum Foo <<:Bar(1) :Baz>>
> > <camelia> rakudo-moar 89470a: OUTPUT«===SORRY!===␤Incompatible MROs
> > in
> > P6opaque rebless for types Bool and Foo␤»

Reply via email to