D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9657 - static if (is(typeof(&method))) broken with "final" and template mixins
Summary: static if (is(typeof(&method))) broken with "final" and template mixins
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2013-03-06 16:42 UTC by Vladimir Panteleev
Modified: 2020-05-25 08:06 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Vladimir Panteleev 2013-03-06 16:42:34 UTC
mixin template InnerMixin()
{
    void method() {}
}

mixin template OuterMixin()
{
final: // This is important for some reason

    mixin InnerMixin;

    // For some reason, this assert passes,
    // even though the "static if" does not
    static assert(is(typeof(&method)));

    // Uncomment this line to get things working:
    //void moreMagic() {}

    static if (!is(typeof(&method)))
        static assert(false, "No 'method' in current context");
}

class Class
{
    mixin OuterMixin;
}
Comment 1 basile-z 2020-05-25 08:06:36 UTC
working since v2.066