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
It seems that one is not able to cast to a polymorphic type directly e.g.
externmod std;fnmain(){let table : std::map::HashMap<int,int> = std::map::HashMap::<int,int>();(table as std::map::Map<int,int>).insert(123,1233);
io::println(table.get(123).to_str());}
does not work, but
externmod std;fnmain(){let table : std::map::HashMap<int,int> = std::map::HashMap::<int,int>();(table as @std::map::Map<int,int>).insert(123,1233);
io::println(table.get(123).to_str());}
does.
It might be a documentation bug if one is only allowed to cast to a trait pointer type (as it is shown in the tutorial that one can cast to Drawable trait directly), or it might be an implementation bug regarding traits with type parameters.