I'm trying to get the current function name and apparently the commented line errors out.

What am I doing wrong?

https://run.dlang.io/is/EGsRU2

```
#!/usr/bin/rdmd

void main()
{
    import std.experimental.all;
    void foo() {
// __traits(identifier, mixin(__FUNCTION__)).writeln; // compilation error
        __FUNCTION__.split('.')[$-1].writeln;
    }
    __traits(identifier, mixin(__FUNCTION__)).writeln;
    __FUNCTION__.split('.')[$-1].writeln;
    foo();
}
```

Reply via email to