[Issue 19640] Linker error when compiling delegate with betterC
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Dec 16 17:41:23 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=19640
Radu Racariu <radu.racariu at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |radu.racariu at gmail.com
--- Comment #2 from Radu Racariu <radu.racariu at gmail.com> ---
As Razvan pointed out, that delegate will create a closure and allocate on the
GC heap.
This is fixable by changing `call` to look like
```
int call(scope int delegate() d)
```
Note the scope keyword.
Also, main should look like
```
extern(C) void main()
```
Please use the learn forums (https://forum.dlang.org/group/learn) before adding
a bug, this kind of information is easily available there.
--
More information about the Digitalmars-d-bugs
mailing list