You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
by kaushansky:
The text was updated successfully, but these errors were encountered: