We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3484534 commit f85b3f7Copy full SHA for f85b3f7
internal/refactor/inline/inline.go
@@ -2622,6 +2622,7 @@ func declares(stmts []ast.Stmt) map[string]bool {
2622
}
2623
2624
2625
+ delete(names, "_")
2626
return names
2627
2628
internal/refactor/inline/inline_test.go
@@ -388,6 +388,17 @@ func TestBasics(t *testing.T) {
388
`func _(ch chan int) { f(ch) }`,
389
`func _(ch chan int) { <-(<-chan int)(ch) }`,
390
},
391
+ {
392
+ // (a regression test for unnecessary braces)
393
+ "In block elision, blank decls don't count when computing name conflicts.",
394
+ `func f(x int) { var _ = x; var _ = 3 }`,
395
+ `func _() { var _ = 1; f(2) }`,
396
+ `func _() {
397
+ var _ = 1
398
+ var _ = 2
399
+ var _ = 3
400
+}`,
401
+ },
402
})
403
404
0 commit comments