[Issue 21387] New: dmd.hdrgen - Wrong parent in pretty name for aggregate instantiated with lambda template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 13 04:02:11 UTC 2020


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

          Issue ID: 21387
           Summary: dmd.hdrgen - Wrong parent in pretty name for aggregate
                    instantiated with lambda template
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: kinke at gmx.net

---
struct ChunkByImpl(alias pred) {}

auto chunkBy(alias pred)()
{
    return ChunkByImpl!pred();
}

void main()
{
    auto foo1 = () => chunkBy!((char a) => a == '_');
    auto foo2 = () => chunkBy!((a) => a == '_');
    import std.stdio;
    writeln("foo1: " , typeid(foo1()).name);
    writeln("foo2: " , typeid(foo2()).name);
}
---

Actual output:
---
foo1: onlineapp.ChunkByImpl!(function (char a) pure nothrow @nogc @safe =>
cast(int)a == 95).ChunkByImpl
foo2: onlineapp.main.__lambda2.ChunkByImpl!(__lambda1).ChunkByImpl
---

Expected output for foo2:
onlineapp.ChunkByImpl!(__lambda1).ChunkByImpl

With QualifyTypes = true:
onlineapp.ChunkByImpl!(onlineapp.main.__lambda2.__lambda1).ChunkByImpl

--


More information about the Digitalmars-d-bugs mailing list