how is this array subtyping inside struct (bug?) possible?

mw mingwu at
Mon Aug 10 19:49:03 UTC 2020

On Monday, 10 August 2020 at 19:30:18 UTC, Steven Schveighoffer 
> This is precisely why classes should never be ranges.

And the user didn't code this range, the range is provided by the 
language standard library:

it's the std library that didn't take into account of the 
array-be-subtyped-as class loop-hole.

Ideally, to the user, subtyping should just perform simple 
forward to the underlying data member, i.e.


should be translated by the *compiler* to:


Obviously it failed to do so here.

More information about the Digitalmars-d mailing list