https://issues.dlang.org/show_bug.cgi?id=16175

          Issue ID: 16175
           Summary: allow statements and declaration in a compiles block
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nob...@puremagic.com
          Reporter: greensunn...@gmail.com

it would be sometimes nice to be able to use expressions and statements inside
the compiles block:

```
int c = 5;
static assert(!__traits(compiles,int* cMutable = &c));
```

I understand if the rationale was to keep `compiles` simple, because most
things can be done with expressions.

Anyway, e.g. for teaching this is quite nice:

https://github.com/stonemaster/dlang-tour/pull/144

--

Reply via email to