[Issue 19479] Garbage .init in string mixins in static foreach in mixin templates

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 6 00:18:57 UTC 2020


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

Dlang Bot <dlang-bot at dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Dlang Bot <dlang-bot at dlang.rocks> ---
@ibuclaw created dlang/dmd pull request #10767 "fix Issue 19479 - Garbage .init
in string mixins in static foreach in mixin templates" fixing this issue:

- fix Issue 19479 - Garbage .init in string mixins in static foreach in mixin
templates

  The problem was that the mixin was being omitted from the codegen during
  the conversion from StaticForeachDeclaration to a Statement.

  The first issue with `toStatement` is that it is visiting all members in
  the StaticForeachDeclaration's `decl`, whereas the semantically compiled
  list of Dsymbols is instead found in `cache`.  This is what caused the
  CompileDeclaration to be omitted.

  The second issue with `toStatement` is that converting an already
  compiled StaticForeachDeclaration into a new StaticForeachStatement
  results in `makeTupleForeach` being called twice for the same
  StaticForeach symbol.  There is no need to create a new
  StaticForeachStatement, simply the unrolling of all members is enough.

https://github.com/dlang/dmd/pull/10767

--


More information about the Digitalmars-d-bugs mailing list