enum on AA's and delegates debug info

Rainer Schuetze r.sagitario at gmx.de
Wed Jul 3 06:25:48 UTC 2019



On 01/07/2019 22:39, Bert wrote:
> On Monday, 1 July 2019 at 06:54:17 UTC, Rainer Schuetze wrote:
>>
>>
>> On 01/07/2019 01:27, Bert wrote:
>>> an AA using an enum uses int as the base type rather than the enum
>>> member name.
>>>
>>> enum X { A, B, C};
>>> AA[X] x;
>>>
>>> will show
>>>
>>> [0]
>>> [1]
>>>
>>> instead of
>>>
>>> [A]
>>> [B]
>>>
>>
>> That's a long standing compiler bug:
>> https://issues.dlang.org/show_bug.cgi?id=982,
>> https://issues.dlang.org/show_bug.cgi?id=4372
>>
> 
> That is unfortunate. Is there not a way to get the proper type?
> 
> In the json file I have
> 
>       "deco" : "HE14test13AADFCQBj6SZv",
>       "originalType" : "X[][A]",
> 
> Here A is the enum, it clearly knows it in the json... I wonder if that
> could be used to realize that the int can be converted to an A?
> 
> Visual D could simply try to convert any values to A and use the name if
> it passes, else fallback to the int.

Probably simpler to fix in the compiler.

> 
>>> It shouldn't be hard to get it to display the names through conversion.
>>>
>>> Also,
>>>
>>> delegates in an array do not show any value. This makes it difficult
>>> to know if they actually any value. Maybe you could just show the
>>> address of the delegate?
>>
>> It also doesn't show a delegate outside of an array. Implemented now
>> for the next release.
> 
> 
> Any ETA on it?

You can try a preliminary build from
https://ci.appveyor.com/project/rainers/mago/build/artifacts by
replacing MagoNatCC.dll in
"<VS-Installation-Path>\Common7\Packages\Debugger".


More information about the Digitalmars-d-ide mailing list