why is this an invalid code?

thanate nospam at spam.com
Sat Oct 30 12:12:48 PDT 2010


Hi,

dmd v2.050 give the following error:

hello.d(10): Error: undefined identifier module hello.dup

for the following code (hello.d):
---------------------
import std.stdio;
import std.array;
import std.string;

void main()
{
  uint[string] s;
  s["a"]=1;
  s["b"]=2;
  uint[string] r = s.dup;
  r["b"]=3;
  writeln(r["b"]," ",s["b"]);
}
---------------------

Could anyone explain why should this be an error?

Thanks!
thanate


More information about the Digitalmars-d-learn mailing list