www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14985] New: [REG2.068.1-b1] Link failure for const TypeInfo

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

          Issue ID: 14985
           Summary: [REG2.068.1-b1] Link failure for const TypeInfo of
                    speculative instantiated struct
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: link-failure
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: k.hara.pg gmail.com

Introduced in:
https://github.com/D-Programming-Language/dmd/pull/4944

Mentioned by Martin Nowak:
https://github.com/D-Programming-Language/dmd/pull/4944#issuecomment-136210663

import std.file;

struct Only(T)
{
    private T _val;
}

auto only(V)(V v)
{
    return Only!V(v);
}

static struct Chain(R...)
{
    R source;
}

auto chain(R...)(R rs)
{
    return Chain!R(rs);
}

void main()
{
    string docRoot;

    chain(
        dirEntries(docRoot , "*.*"   , SpanMode.shallow),
        only(docRoot)
    );
}

--
Aug 30 2015