[Issue 23620] 'alias this' is not respected in static array length position

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 17 00:33:30 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23620

Basile-z <b2.temp at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp at gmx.com

--- Comment #10 from Basile-z <b2.temp at gmx.com> ---
(In reply to Salih Dincer from comment #4)
> This isn't a bug!
> 
> void main()
> {
>   struct Index 
>   { 
>     size_t value; 
>     alias value this; 
>   } 
>   
>   enum size_t i = Index(); 
>   int[i] a;
>   int[cast(size_t)Index()] b;
>   static assert(a.length == b.length);
> }

before the fix DMD did a hidden cast a cast but too late.

--


More information about the Digitalmars-d-bugs mailing list