Fix incorrect UseUndeclaredVariable warnings
There were two bugs:
- Methods from Systemlib traits that were imported into user
code were still marked as system methods, so we didnt run
type inference on them, so the parameter wasn't annotated correctly;
- If we couldn't determine whether a function argument was by reference
or not, we could end up marking *that* as being the thing that set
the parameter. If later we figured out which function was being called,
we marked it as *not* by reference, and then it looked like it was being
used without being set.
With this diff, we set the system/user flag correctly when cloning methods,
and always mark the "declaration" of a parameter as the parameter itself.
Differential Revision:
D920269