Debugger shows base as type
Rainer Schuetze
r.sagitario at gmx.de
Mon Dec 17 08:36:22 UTC 2018
On 16/12/2018 05:14, Michelle Long wrote:
> The debugger shows a type as it's base type, at least with arrays:
>
> class A; class B : A;
>
> A[] As;
>
> As ~= B;
>
> Then A[0] is shown as an A.
>
> In fact, it shows A then B inside A, something like
>
> A
> B
> ...
> ...
>
>
> I think it is more natural to have the most derived shown first AND if
> the parent has just one or two fields or three fields(possibly depending
> inversely on how many the child has, up to a max of 10, say) they are
> consumed by the child.
>
> class A
> {
> int x;
> }
>
> class B : A
> {
> int y;
> int z;
> }
>
> Would look like
>
> B
> x
> y
> z
>
> while currently it is like
>
> A
> B
> y
> z
> x
>
>
>
> If A had more then it would fall in to a sub tree.
>
> It should always try to use the most derived type for the type since as
> programmers that is how we think about them.
>
> This requires us digging down a hierarchy to find the types values that
> we generally want to know most about.
There's already the option to show base class members as part of a flat
list for all members. I guess this should just include the members of
the dynamic type aswell. Limiting it to some number of fields seems too
arbitrary.
There'd be no display of that derived type anywhere, though. IIRC C#
shows it in curly braces after the declared type.
More information about the Digitalmars-d-ide
mailing list