[Issue 16705] [REG2.069] TaskPool.reduce fails to compile "cannot get frame pointer to D main"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 9 20:39:25 UTC 2021


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

Ajieskola at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Ajieskola at gmail.com

--- Comment #12 from Ajieskola at gmail.com ---
Simplified case of what the frame pointer error is about:

```d
void main()
{ struct X{ void x(){} }
  auto a = defInit!X;
}

auto defInit(T)(){ return T(); }
```

This won't work, because `struct X` default constructor needs a hidden pointer
to `main` local variables, and `defInit` does not have that pointer. So far, so
good.

However, it also fails in this form:

```d
void main()
{ auto a = defInit!(X!(x=>1));
}

struct X(alias f){ void x(){} }
auto defInit(T)(){ return T(); }
```

I would have expected this one to pass. `x=>1` is completely context
independant, so theoretically `X` should not need a frame pointer to `main()`.
I'm not sure what the langauge spec says about this.

--


More information about the Digitalmars-d-bugs mailing list