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: [email protected]
Reporter: [email protected]
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!
}
--