[Issue 22327] [Templates] arguments of T[] literals work for exactly one initialization before being set in stone

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 5 02:02:34 UTC 2021


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

mhh <maxhaton at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxhaton at gmail.com

--- Comment #5 from mhh <maxhaton at gmail.com> ---
------------------
TemplateInstance.findBestMatch()
foo(T, T[] somedata_) @ 0x7fe5e3c38810 hash is 781bbdffb091
        ++foo(T, T[] somedata_)
        It's a match with template declaration 'foo(T, int[] somedata_)'
        ++foo(T, int[] somedata_) at end of scope
------------------

Inside findBestMatch it looks like the template is considered and (for the
first time round) matches successfully, but the process of doing this actually
changes the TemplateDeclaration itself as shown above (see the difference
between the two lines marked with pluses).

--


More information about the Digitalmars-d-bugs mailing list