Skip to content

Commit

Permalink
Merge pull request #398 from BBasile/fix-finalattrib
Browse files Browse the repository at this point in the history
prevent to check for final attribs inside templates
  • Loading branch information
Hackerpilot authored Feb 4, 2017
2 parents 1ee0333 + 7686dd0 commit 5f40f5a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/analysis/final_attribute.d
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -266,6 +276,13 @@ public:
}
}, sac);

assertAnalyzerWarnings(q{
mixin template Impl()
{
protected final void mixin_template_can() {}
}
}, sac);

// fail

assertAnalyzerWarnings(q{
Expand Down

0 comments on commit 5f40f5a

Please sign in to comment.