[Issue 14346] is-expression dependent on instantiation order

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 14 15:46:01 UTC 2022


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

RazvanN <razvan.nitu1305 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305 at gmail.com
         Resolution|---                         |FIXED

--- Comment #4 from RazvanN <razvan.nitu1305 at gmail.com> ---
(In reply to ag0aep6g from comment #3)
> Reduced further:
> 
> ----
> template typeOf(alias From)
> {
>     alias typeOf = typeof(From);
> }
> 
> string val;
> int embedded;
> 
> void main()
> {
>     foreach(UDA; Tuple!val)
>     {
>         pragma(msg, typeOf!UDA); /* prints "string", ok */
>     }
>     foreach(UDA; Tuple!embedded)
>     {
>         /* THE RESULT OF THIS DEPENDS ON THE LINE ABOVE: */
>         pragma(msg, typeOf!UDA); /* prints "string", should print "int" */
>     }
> }
> 
> alias Tuple(stuff ...) = stuff;
> ----
> 
> This is very similar to issue 14501.

When running the above code the second pragma prints int as expected. It seems
that this has been fixed.

--


More information about the Digitalmars-d-bugs mailing list