[Issue 7721] Nested template loses context when mixin'd

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 13 09:02:01 UTC 2018


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

Simen Kjaeraas <simen.kjaras at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Loss of template context    |Nested template loses
                   |when passed as template     |context when mixin'd
                   |template parameter          |

--- Comment #1 from Simen Kjaeraas <simen.kjaras at gmail.com> ---
Simplified example showing template template parameters are unnecessary to
trigger this bug:

template Bar(T) {
    template Baz() {
        T n;
    }
}

unittest {
    // Works.
    Bar!int.Baz!().n = 3;
    // Fails: foo.d(3): Error: undefined identifier T
    mixin Bar!int.Baz!();
}

--


More information about the Digitalmars-d-bugs mailing list