Skip to content

runtime: how should a nil go or nil defer behave? #8109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
randall77 opened this issue May 27, 2014 · 1 comment
Closed

runtime: how should a nil go or nil defer behave? #8109

randall77 opened this issue May 27, 2014 · 1 comment

Comments

@randall77
Copy link
Contributor

go ((func())(nil))()

Should it panic in the calling go routine, or at the start of the called goroutine?

    defer ((func())(nil))()

Should it panic at the defer statement, or at the return point?

We've had some argument either way.  Panicing in the calling goroutine / at defer
statement is failing early, might be useful for people.  Panicing late might be
expected, as the go/deferred routine doesn't actually use the nil value until then.

Panicing late is what we do now.

The runtime meeting decided gri should figure this out, maybe update the spec.

Related to issues 8045 (go) and 8047 (defers).
@griesemer
Copy link
Contributor

Comment 1:

Status changed to Duplicate.

Merged into issue #8107.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants