-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed as not planned
Labels
FrozenDueToAgecompiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Description
What version of Go are you using (go version
)?
$ go version go version go1.19rc2 linux/amd64
Also for many previous versions.
Does this issue reproduce with the latest release?
Yes
What did you do?
package main
func main() {}
func foo() (err error) {
{
err := bar()
if err != nil {
return
}
}
return
}
func bar() error {
return nil
}
What did you expect to see?
Complies okay.
What did you see instead?
Fails to compile.
$ go run main.go
# command-line-arguments
./main.go:9:4: result parameter err not in scope at return
./main.go:7:3: inner declaration of var err error
Metadata
Metadata
Assignees
Labels
FrozenDueToAgecompiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.