Zefram,

> On 13 Dec 2015, at 05:56, Zefram (via RT) <perl6-bugs-follo...@perl.org> 
> wrote:
> 
> # New Ticket Created by  Zefram 
> # Please include the string:  [perl #126891]
> # in the subject line of all future correspondence about this issue. 
> # <URL: https://rt.perl.org/Ticket/Display.html?id=126891 >
> 
> 
>> my Int $a = CORE
>> $a.WHAT.say
> (CORE)
>> CORE.^isa(Int)
> Cannot call isa(Perl6::Metamodel::ModuleHOW: CORE, Int); none of these 
> signatures match:
>    (Mu \SELF: Mu $type, *%_)
>    (Mu \SELF: Str:D $name, *%_)
>  in block <unit> at <unknown file>:1
>> (sub (Int $a) { 1 })(CORE)
> Type check failed in binding $a; expected Int but got CORE
>  in sub  at <unknown file>:1
>  in block <unit> at <unknown file>:1
> 
> CORE is a module object; other module objects behave similarly.  As shown
> above, they can be assigned to type-constrained variables despite not
> meeting the type constraint.  Additionally, the .^isa method fails to
> operate on them; don't know whether these two faults are really related.
> Type constraint does apply as expected to a subroutine parameter.

thanks for submitting these tickets!

Some further data points:

This seems to apply to any variable type and any PseudoStash:

$ 6 'my Str $a = MY; say $a'
(MY)

Oddly enough, binding *does* fail with a typecheck error:

$ 6 'my Str $a := GLOBAL'
Type check failed in binding; expected Str but got GLOBAL
  in block <unit> at -e:1




Liz

Reply via email to