Skip to content
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

gccgo: _ = nil should not be permitted #6005

Closed
griesemer opened this issue Jul 31, 2013 · 3 comments
Closed

gccgo: _ = nil should not be permitted #6005

griesemer opened this issue Jul 31, 2013 · 3 comments

Comments

@griesemer
Copy link
Contributor

The assignments

   _ = nil
   var _ = nil

are accepted by gccgo w/o error. However they should not be permitted.

The spec is unclear, but gc does not permit it. Also, there shouldn't be a difference
between

   var a = nil

(not permitted) and the same assignment using _ instead of a. Furthermore:

   _ = 1<<63

is not permitted (integer constant overflow), while

   _ = 1<<62

is ok - indicating that such assignments are treated like other assignments with
initialization expressions. nil should not be a special case.
@griesemer
Copy link
Contributor Author

Comment 1:

Labels changed: added gccgo.

@ianlancetaylor
Copy link
Member

Comment 2:

Removing Go1.2Maybe tag: not a gc release issue.

Labels changed: removed go1.2maybe.

@ianlancetaylor
Copy link
Member

Comment 3:

Fixed on tip.

Owner changed to @paranoiacblack.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
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

4 participants