Thread overview
[Issue 20275] Tuple created in template in with() includes with-symbol
Nov 03, 2019
Basile-z
Mar 21, 2020
Basile-z
Dec 17, 2022
Iain Buclaw
Aug 19, 2023
Basile-z
November 03, 2019
https://issues.dlang.org/show_bug.cgi?id=20275

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

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

--- Comment #1 from Basile-z <b2.temp@gmx.com> ---
little more clear:

---
enum E { A }

alias GlobalEnumMembers(T) = __traits(allMembers, T);

void main()
{
    pragma(msg, GlobalEnumMembers!E.stringof);
    with (S())
    {
        pragma(msg, EnumMembers!E.stringof); // (*__withSym).tuple("A")
    }
}

struct S
{
    alias EnumMembers = GlobalEnumMembers;
}
---


so  "(*__withSym)" is just a `S` and  ".tuple("A")" the member tuple, i.e the
alias.While this is distrurbing, I don't see a bug. This is like

---
enum E { A }


alias GlobalEnumMembers(T) = __traits(allMembers, T);

void main()
{
    pragma(msg, GlobalEnumMembers!E.stringof);
    S s;
    {
        pragma(msg, s.EnumMembers!E.stringof);
    }
}

struct S
{
    alias EnumMembers = GlobalEnumMembers;
}
---

which prints s.tuple("A").

The only thing is that `with(S())` creates a kind of anonymous/temp variable.

voting for close as invalid.

--
March 21, 2020
https://issues.dlang.org/show_bug.cgi?id=20275

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

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

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=20275

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
August 19, 2023
https://issues.dlang.org/show_bug.cgi?id=20275

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |b2.temp@gmx.com
         Resolution|---                         |WORKSFORME

--- Comment #2 from Basile-z <b2.temp@gmx.com> ---
fixed in 2.101.2

--