[Issue 17397] New: Lazy attribute propagation incorrect

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun May 14 06:25:44 PDT 2017


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

          Issue ID: 17397
           Summary: Lazy attribute propagation incorrect
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: eyal at weka.io

In continuation to https://issues.dlang.org/show_bug.cgi?id=16540, these are
still buggy:

void foo(scope lazy int* f) @nogc {}
void vararg_foo(Args...)(scope lazy Args args) @nogc {}

// Compiles fine
void bar1() @nogc { foo(new int(5)); }

// Incorrectly fails!
void bar2() @nogc {
    int* f() { return new int(5); }
    foo(f()); // f() should not be called here!
}

// Incorrectly fails!
void bar3(scope lazy int* x) @nogc {
    vararg_foo(x); // x should not be evaluated here!
}

--


More information about the Digitalmars-d-bugs mailing list