# New Ticket Created by  Ron Schmidt 
# Please include the string:  [perl #93980]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=93980 >


 From the IRC discussion: 
http://irclog.perlgeek.de/perl6/2011-07-03#i_4051503

13:49   TimToady
        nom: my Str $a = Nil;
13:49   p6eval
        nom: OUTPUT«Type check failed in assignment to '$a'; expected 'Str' but 
got 'Nil'␤current instr.: '_block1002' pc 28 ((file unknown):0) (:1)␤»
13:50   TimToady
        rakudo: my Str $a = Nil;
13:50   p6eval
        rakudo 72d158: OUTPUT«Type check failed for assignment␤    Container 
type: Str␤               Got: Nil␤  in '&infix:<=>' at line 
1:src/metamodel/RoleToInstanceApplier.nqp␤  in main program body at line 
22:/tmp/jK7jxCEjPS␤»
13:50   * TimToady
        is a bit surprised that fails
13:56   PhatEddy
        The case of of not enough initializers I thought I understood well 
enough for a bug report but I am less sure of the scalar assignment to Nil.  I 
am guessing scalar assignment to nil usually does nothing?
13:57   s/to nil/from nil/
13:58   TimToady
        see S02:2240

S02:2240 reads in part - Assigning C<Nil>  to any scalar container causes the
container to throw out any contents and restore itself to an
uninitialized state (after which it will contain a type object
appropriate to the declared type of the container, where C<Any>
is the default type).

Also note:

14:05   PhatEddy
        nom: my $x = Nil; say $x.perl
14:05   p6eval
        nom: OUTPUT«Nil␤»
14:05   PhatEddy
        rakudo: my $x = Nil; say $x.perl
14:05   p6eval
        rakudo 72d158: OUTPUT«Any␤»
14:06   PhatEddy
        rakudo is OK here I'm guessing ...
14:06   TimToady
        yes

Reply via email to