Consider:
```
void main() {
      int     IntVar1 = 12;

      static if (is(typeof(IntVar1) == int)) {
      } else {
         static assert (false, "Type not int.");
      }
}
```
which compiles correctly.

But the inverse logic:
```
void main() {
      int     IntVar1 = 12;

      static if (is(typeof(IntVar1) != int)) {
         static assert (false, "Type not int.");
      } else {
      }
}
```
fails to compile with:
```
test.d(19): Error: found `!=` when expecting `)`
      static if (is(typeof(IntVar1) != int)) {
                                    ^
test.d(19): Error: found `int` when expecting `)`
      static if (is(typeof(IntVar1) != int)) {
                                       ^
test.d(19): Error: found `)` instead of statement
      static if (is(typeof(IntVar1) != int)) {
                                          ^
test.d(22): Error: declaration expected, not `else`
      } else {
        ^
```

Using DMD64 D Compiler v2.112.0 Windows 10


PS Problem with forum.dlang.org - keeps timing out?

Reply via email to