Summary: Closure not recognized when passing type with
                    post-blit as lazy parameter
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from David Nadlinger <> 2012-11-03 07:20:13 
PDT ---
This is a follow-up to the thread �Expression::apply, DeclarationExp and a
possible nested context bug� on dmd-internals:

The following test case shows that the problem I brought up there there also
leads to wrong-code bugs in DMD (at least I hope it's still the original
problem, I simply extended this from the minimal testcase linked in the

extern(C) void printf(const char*, ...);

struct HasPostblit {
    this(this) {};

struct Foo {
    HasPostblit hp;
    int i;

void print(Foo f) {
    printf("%x\n", f.i);

auto toDg(E)(lazy E e) {
    return { return e(); };

auto getDg() {
    Foo a;
    a.i = 0x1;
    return toDg(print(a));

void smashStack() {
    int[1024] dummy = 0xcafebabe;

void main() {
    auto d = getDg();

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to