Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

Nil.gist goes missing via type parameter #4564

Open p6rt opened 9 years ago

p6rt commented 9 years ago

Migrated from rt.perl.org#126118 (status was 'open')

Searchable as RT126118$

p6rt commented 9 years ago

From zefram@fysh.org

$ ./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 \ 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

p6rt commented 6 years ago

From @AlexDaniel

That's a nice one. Still reproducible (2017.11, HEAD(5929887))

On 2015-09-20 09​:29​:41, zefram@​fysh.org wrote​:

$ ./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 \ 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

p6rt commented 6 years ago

The RT System itself - Status changed from 'new' to 'open'