On 08/18/2012 02:15 PM, Salih Dincer wrote:
This may be the solution...:)
char[] b = cast(char[])"abc".dup; // ok, unique reference
Sorry...
You don't need the cast in this case.
Topic: It is not a bug, but it might be surprising because the
behaviour of typeid is different with polymorphic types.
Typeid on a class object gives you back the RTTI structure of the
value's type, while typeid on anything else gives you back the RTTI
of the statically determined variable type.
The reason this works this way is because class objects are the only
objects which actually carry runtime type information with them.