Ddbg 0.09 beta release

Jascha Wetzel firstname at mainia.de
Fri Jun 15 03:23:49 PDT 2007


Ary Manzana wrote:
> I have a question: I tried inspecting an associative array.
> 
> char[][int] dictionary;
> dictionary[1] = "one";
> dictionary[2] = "one";
> 
> ->= dictionary
> {
>   1 = ...,
>   2 = ...
> }
> ->= dictionary[1]
> Invalid key type for associative array. Expected i found k
> 
> What does that mean?

means you found a bug ;)
the types get output in mangled form (changed in 0.09.2). so the message 
says: i found a uint but needed an int.
integer constants are uints atm.
the bug you (implicitly) found is, that expressions may not be 
constants. that means neither "1" nor "cast(int)1" is a valid 
expression. therefore you couldn't fix this by writing 
"dictionary[cast(int)1]" - in 0.09.2 you can.
besides that, i will add implicit casts to handle this more smoothly, 
sometime...



More information about the Digitalmars-d-announce mailing list