Closed
Description
This issue tracks bugs encountered while using the new change signature/parameter movement feature.
Aggregating into a single issue for convenience; I'll keep adding to this list as I encounter bugs.
- Unnecessary conversion between named and unnamed concrete types (example: passing
type Hash [32]byte
as an argument to a[32]byte
parameter, we see that the inliner adds unnecessary conversions to[32]byte
. I avoided unecessary interface->interface conversions, but we also don't need to worry about concrete->concrete. - Given a call site involving a short variable declaration (
x, y := Foo(1, 2)
), the inliner thinks it needs to introduce a binding declaration for x, y. - We offer to move variadic parameters... and then fail to type check the resulting modified package because we don't do it correctly. For now, we should not offer the parameter movement code action, if it involves a variadic parameter (my intuition is that supporting variadics would be too complicated to fix presently).
- The inliner is too conservative about side effects. For change signature refactoring, we should ignore effects.
- The rewrite used for change signature refactoring is liable to run into argument variables shadowed by other parameters. We can avoid this using shadow groups.