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
internal/refactor/inline: substitute groups of dependent arguments
In change signature refactoring, the wrapper was very likely to run into
a particular unidiomatic behavior of the inliner, where arguments were
detected as unsubstitutable because they have free variables shadowed by
other parameters. But if those other parameters are going to be
substituted, this shadowing is irrelevant.
Fix this by keeping track of shadowing from other parameters in a new
shadowMap type, and then analyzing these relationships during
substitution to detect cases where closed subgraphs of parameters can be
substituted simultaneously.
Also: fix a formatting bug (golang/go#67335) that was reproduced by one
of the new tests: we need to clear positions when using nodes from the
callee in the caller's binding decl.
For golang/go#70599Fixesgolang/go#67335
Change-Id: I08970a1cea8a82ea108084394569cffbc5975235
Reviewed-on: https://go-review.googlesource.com/c/tools/+/633256
Reviewed-by: Alan Donovan <[email protected]>
Auto-Submit: Robert Findley <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Copy file name to clipboardExpand all lines: gopls/internal/test/marker/testdata/codeaction/issue64558.txt
+1-1
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ go 1.18
8
8
package a
9
9
10
10
func _() {
11
-
f(1, 2) //@ diag("2", re"too many arguments"), codeaction("f", "refactor.inline.call", end=")", err=re`inlining failed \("args/params mismatch"\), likely because inputs were ill-typed`)
11
+
f(1, 2) //@ diag("2", re"too many arguments"), codeaction("f", "refactor.inline.call", end=")", err=re`inlining failed \("too many arguments"\), likely because inputs were ill-typed`)
0 commit comments