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

map[interface{}] issue #357

Closed
gopherbot opened this issue Nov 30, 2009 · 4 comments
Closed

map[interface{}] issue #357

gopherbot opened this issue Nov 30, 2009 · 4 comments

Comments

@gopherbot
Copy link
Contributor

by kaushansky:

The following doesn't compile:
  m:=make(map[interface{}] int);
  m[1]=0;

It complains that "1" is not an interface{}. However, compiler
automatically converts int to interface{} when passed as a parameter to
function expecting interface{}, and in general, it's assignment-compatible
with interface{}.
Explicit type cast (interface{})(1) works fine.
(Problem is not specific to int - any other type will fail either)
@griesemer
Copy link
Contributor

Comment 1:

Owner changed to g...@golang.org.

Status changed to Thinking.

@rsc
Copy link
Contributor

rsc commented Dec 2, 2009

Comment 2:

Labels changed: added language-change.

@rsc
Copy link
Contributor

rsc commented Dec 2, 2009

Comment 3:

Labels changed: added languagechange, removed language-change.

@griesemer
Copy link
Contributor

Comment 4:

This issue was closed by revision 29f1ca5.

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

3 participants