[Issue 20053] mixin doesn't work for many expressions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 23 09:14:29 UTC 2019


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

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com

--- Comment #2 from Walter Bright <bugzilla at digitalmars.com> ---
> Lots of expressions don't work as mixin

They do. Compile mixins come in three forms:

1. declaration
2. statement
3. expression

The form they don't come in is as a type, which is what your example requires.

Also:

    alias E = Expression;

where Expression is a general expression, doesn't work. For example,

    int x;
    alias Y = x + x;

doesn't work.

I supposed type mixins could be added, but I haven't seen a request for this
before.

--


More information about the Digitalmars-d-bugs mailing list