You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my$x=42;
LEAVEsay$x.Int; # ← WRONG; assumes that $x is not Nil
This is true even if $x is defined at the start of the block.
For example:
subfoo($where‘abc’) {
my$x=42;
LEAVEsay$x.Int; # ← WRONG; assumes that $x is not Nil
}
say foo ‘hello’; # OUTPUT: «No such method 'Int' for invocant of type 'Any'»
The text was updated successfully, but these errors were encountered:
It is a fairly common mistake.
Basically, code like this is wrong:
This is true even if $x is defined at the start of the block.
For example:
The text was updated successfully, but these errors were encountered: