-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.
Milestone
Description
gopls version
golang.org/x/tools/gopls@(devel)
What did you do?
Input file:
package main
func main() {
var x any
for {
switch x.(type) {
default:
break
}
}
}
CLI invocation:
$ ~/prj/bin/gopls highlight ./bar.go:8:5
Log: Loading packages...
Info: Finished loading packages.
/home/dominikh/prj/src/example.com/bar.go:5:2-5
/home/dominikh/prj/src/example.com/bar.go:8:4-9
What did you see happen?
bar.go:5:2-5 corresponds to the for
keyword.
What did you expect to see?
The break
statement breaks from the switch
statement, not the for
loop. Gopls does handle this correctly for value switches, but not for type switches.
Editor and settings
No response
Logs
No response
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.