# New Ticket Created by Zefram
# Please include the string: [perl #128409]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=128409 >
> (sub () { my $a = 22; my $b = $a.VAR; $b.WHAT.say; $b })().WHAT.say
(Scalar)
(Int)
$b is a Scalar, and the subroutine attempts to return it. The caller
doesn't receive it; instead it receives the Int that was contained in
the Scalar. This happens specifically when the sub has the Scalar in
a variable and the return expression is a reference to that variable.
If the return expression is "$a.VAR", then the caller receives the Scalar
as expected.
-zefram