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

          Issue ID: 14376
           Summary: false positive "Error: one path skips field"
           Product: D
           Version: unspecified
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nob...@puremagic.com
          Reporter: ag0ae...@gmail.com

Fails with "test.d(6): Error: one path skips field x". Should be accepted.

struct ParameterValue
{
    typeof(f()) x;
    this(int dummy)
    {
        if(true) this.x = f(); /* line 6 */
        else assert(false);
    }
}
auto f()
{
    return MapResult!(e => 0)();
}
struct MapResult(alias pred)
{
    @property int front() {return pred(0);}
}

--

Reply via email to