[Issue 20776] No error is given out for wrong static if expression

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 27 09:38:56 UTC 2020


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

moonlightsentinel at disroot.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |moonlightsentinel at disroot.o
                   |                            |rg
         Resolution|---                         |INVALID

--- Comment #1 from moonlightsentinel at disroot.org ---
This is the expected behaviour of an is-expression. Unqal is not a function but
a template aliasing to another type. `Unqal!K` isn't a valid type once you omit
the import which causes the `is` to evaluate to false.

> Type is the type being tested. It must be syntactically correct, but it
> need not be semantically correct. If it is not semantically correct, the
> condition is not satisfied.

See https://dlang.org/spec/expression.html#is_expression

--


More information about the Digitalmars-d-bugs mailing list