On Monday, 2 August 2021 at 11:28:46 UTC, Tejas wrote:
On Monday, 14 June 2021 at 13:31:51 UTC, baby_tiger wrote:
[...]
It seems to not work at runtime either. Maybe they've made this
behaviour illegal now? Hopefully someone answers.
```d
import std.traits;
import core.stdc.stdarg;
enum LogLevel : ubyte {
INFO = 0,
WARN,
ERROR,
FATAL,
}
extern (C) string VFORMAT(LogLevel level, string file, size_t
line, char[] tmp, bool line_break, string tag, string fmt, ...)
@nogc nothrow {
return null;
}
extern (C) string function(LogLevel level, string file, size_t
line, char[] tmp, bool line_break, string tag, string fmt, ...)
@nogc nothrow pure fp;
void main(){
fp = &VFORMAT; //fails
}
```
Try this:
```d
void main(){
fp = cast(typeof(fp))&VFORMAT; //fails
}
```