Raku / old-issue-tracker

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

type smileys don't work on ::?CLASS #5812

Open p6rt opened 7 years ago

p6rt commented 7 years ago

Migrated from rt.perl.org#130151 (status was 'new')

Searchable as RT130151$

p6rt commented 7 years ago

From @zoffixznet

m​: class C { method foo (--> :​:?CLASS​:D) { self } }; say .foo given C rakudo-moar 080630​: OUTPUT«(C)␤»

Expected​: typecheck failure, since `self` is not :D

And using :​:?CLASS​:D in the body of the method errors out, saying you
can't adverb :​:?CLASS​:

m​: class C { method foo (--> :​:?CLASS​:D) { say (​::?CLASS​:D).HOW; self;
} }; say .foo given C rakudo-moar 080630​: OUTPUT«5===SORRY!5=== Error while compiling
\␤You can't adverb :​:?CLASS␤at \​:1␤------> 3d foo (-->
:​:?CLASS​:D) { say (​::?CLASS​:D7⏏5).HOW; self; } }; say .foo given C␤
expecting any of​:␤ pair value␤»

https://irclog.perlgeek.de/perl6/2016-11-22#i_13611710