diff --git a/src/dscanner/analysis/final_attribute.d b/src/dscanner/analysis/final_attribute.d index e52fc90..7616aa7 100644 --- a/src/dscanner/analysis/final_attribute.d +++ b/src/dscanner/analysis/final_attribute.d @@ -149,12 +149,14 @@ public: undoBlockStatic = true; } + const bool wasFinalAggr = _finalAggregate; scope(exit) { d.accept(this); _parent = savedParent; if (undoBlockStatic) _blockStatic = false; + _finalAggregate = wasFinalAggr; } if (!d.attributeDeclaration && @@ -402,5 +404,14 @@ public: FinalAttributeChecker.MSGB.format(FinalAttributeChecker.MESSAGE.class_s) ), sac); + + assertAnalyzerWarnings(q{ + class Statement + { + final class UsesEH{} + final void comeFrom(){} + } + }, sac); + stderr.writeln("Unittest for FinalAttributeChecker passed."); }