```
public
struct CommandLineInterfaceOption
{
immutable public string token;
immutable public void function (string) callback;
this (string token, void function (string) callback);
}
```
This compiles, even though `this` is undefined.
Is this supposed to happen?
Comment #1 by issues.dlang — 2017-12-04T18:50:40Z
It's perfectly legal to declare functions without bodies. That's what you would typically do in a .di file. The actual function body would then be in the corresponding .d file. Most of the time, there's no reason to bother with .di files, but in order for them to work, it's required that any function that does not absolutely need its body to be present be able to not have its body present (stuff like auto return functions and templated functions require their bodies, but a normal function doesn't). Similarly, in some cases, the body may be in a separate library entirely (though that's pretty much only with extern(C) functions where the D declaration is just so that the D code can use an existing C function).
You'll get a linker error as soon as you try to use the function if a function body hasn't been linked in.