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


After a recent change to roast [1] there are some new failing tests on
the JVM backend similiar to this one:

$ ./perl6-j -Ilib -e 'use Test; is({"a" => 1}.keyof, Str(Any))'
not ok 1 - 
# Failed test at -e line 1
# expected: (?(?))
#      got: (?(?))

If I'm not mistaken, the underlying problem is, that information about
a parametric type is not available once something like Str(Any)
(Perl6::Metamodel::CoercionHOW) is put into a container.

$ ./perl6-j -e 'use nqp; my $bar = Str(Any); say 
nqp::isnull(nqp::typeparameterized($bar)); say $bar.^name; say 
nqp::isnull(nqp::typeparameterized(nqp::decont($bar))); say 
nqp::decont($bar).^name'
1
?(?)
0
Str(Any)

This does not happen on MoarVM:

$ ./perl6-m -e 'use nqp; my $bar = Str(Any); say 
nqp::isnull(nqp::typeparameterized($bar)); say $bar.^name; say 
nqp::isnull(nqp::typeparameterized(nqp::decont($bar))); say 
nqp::decont($bar).^name'
0
Str(Any)
0
Str(Any)

I'm not sure if this should to be fixed in JVM specific code (nqp) or
at a higher level (using nqp::decont in Rakudo). Currently we don't
use any nqp::decont in src/Perl6/Metamodel/CoercionHOW.nqp and
friends.

[1] https://github.com/perl6/roast/commit/7145799cce

Reply via email to