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

Chris Wright <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from Chris Wright <[email protected]> ---
`typeof` is a keyword with specific syntax. In order for the compiler to get to
the point where it runs `__traits(complies, ...)`, it has to successfully parse
your code. If you violate syntax rules, as in your example, it can't
successfully parse your code.

This is similar to the rule that code inside inactive `version` blocks must be
parseable.

In order to handle cases like this, you can use string mixins:

    static assert(!__traits(compiles, {mixin(q{alias justTypes = ...;});}));

--

Reply via email to