Yes, it would be awesome to have warnings for unused params and variables.

On 2018-01-14 12:16:08, c...@zoffix.com wrote:
> On Sat, 14 Oct 2017 20:53:03 -0700, alex.jakime...@gmail.com wrote:
> > FWIW I made a throwaway script that looks for unused params, and
> > there
> > are many
> > of these in rakudo sources. Of course, most of these cases are not in
> > hot
> > paths, but the overall performance benefit may be very noticeable.
> >
> > There are also cases like this:
> > https://github.com/rakudo/rakudo/blob/nom/src/core/IO/Socket/Async.pm#L313-
> > L315
> > where named arg is present in the signature but does absolutely
> > nothing (or so
> > it seems?).
> >
> > Dunno if I should post the results. There are many false-positives
> > and
> > I guess
> > many cases are not caught at all, so a proper approach is needed if
> > we
> > really
> > want to replace all these with $.
>
> Wouldn't a warning about unused variables be more appropriate
> than silently rewriting them to `$`? Their names can be introspected
> and used for
> something by they user. We actually do do that in core (sub MAIN USAGE
> generation).
>
> That Proc::Async line you point out actually has a bug in it and a
> warning would've detected it.

Reply via email to