Skip Menu |
Report information
Id: 126118
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: zefram [at] fysh.org
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



To: rakudobug [...] perl.org
From: Zefram <zefram [...] fysh.org>
Date: Sun, 20 Sep 2015 17:29:28 +0100
Subject: Nil.gist goes missing via type parameter
Download (untitled) / with headers
text/plain 680b
$ ./perl6 -e 'sub aa (Mu:U ::T) { say T; my T $a = T; say $a.WHAT; }; aa(Int); aa(Nil)' (Int) (Int) Nil Method 'gist' not found for invocant of class 'T' in sub aa at -e:1 in block <unit> at -e:1 I'm mystified as to how the gist method goes missing there. It seems entirely available when I'm not using a type parameter: $ ./perl6 -e 'say Int; my Int $a = Int; say $a.WHAT; say Nil; my Nil $b = Nil; say $b.WHAT;' (Int) (Int) Nil Nil I also don't get an error if the "= T" is omitted, which is bizarre because the variable contains the same value by default. The error doesn't occur at the time of the assignment, though: it only happens with the say statement. -zefram
That's a nice one. Still reproducible (2017.11, HEAD(5929887))

On 2015-09-20 09:29:41, zefram@fysh.org wrote:
Show quoted text
> $ ./perl6 -e 'sub aa (Mu:U ::T) { say T; my T $a = T; say $a.WHAT; };
> aa(Int); aa(Nil)'
> (Int)
> (Int)
> Nil
> Method 'gist' not found for invocant of class 'T'
> in sub aa at -e:1
> in block <unit> at -e:1
>
> I'm mystified as to how the gist method goes missing there. It seems
> entirely available when I'm not using a type parameter:
>
> $ ./perl6 -e 'say Int; my Int $a = Int; say $a.WHAT; say Nil; my Nil
> $b = Nil; say $b.WHAT;'
> (Int)
> (Int)
> Nil
> Nil
>
> I also don't get an error if the "= T" is omitted, which is bizarre
> because the variable contains the same value by default. The error
> doesn't occur at the time of the assignment, though: it only happens
> with the say statement.
>
> -zefram




This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org