this code give error:

```d
static if(  !__traits(compiles, mixin("enum v = V;")) ) {
   enum v = V;
}

```

```sh
Error: static variable `NotWorkVar` cannot be read at compile time
```

V is alias get from `typeof(__traits(getMember, M, symbol)`, M is `module` from importC.


the importC source "test.h" code for `NotWorkVar`

```c
extern const float NotWorkVar;
```

I am try to ` static foreach(symbol; __traits(allMembers, importCModule))`, and want to check if the symbol is `static variable` or not at compile time.


Reply via email to