# 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.

-zefram

Reply via email to