www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14376] New: false positive "Error: one path skips field"

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: nobody puremagic.com
          Reporter: ag0aep6g 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);}
}

--
Mar 29 2015