prevent to check for final attribs inside templates

since they might be mixed or not, in structs or not
This commit is contained in:
Basile Burg 2017-02-04 02:38:20 +01:00
parent 1ee033392c
commit 7686dd0ecc
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
1 changed files with 17 additions and 0 deletions

View File

@ -110,6 +110,16 @@ public:
_parent = saved;
}
override void visit(const(MixinTemplateDeclaration) mtd)
{
// can't really know where it'll be mixed (class |final class | struct ?)
}
override void visit(const(TemplateDeclaration) mtd)
{
// regular template are also mixable
}
override void visit(const(Declaration) d)
{
const Parent savedParent = _parent;
@ -266,6 +276,13 @@ public:
}
}, sac);
assertAnalyzerWarnings(q{
mixin template Impl()
{
protected final void mixin_template_can() {}
}
}, sac);
// fail
assertAnalyzerWarnings(q{