From 7a2d5f7e73607e08b279aeffbebe3a9f8abdc6f3 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Sun, 18 May 2014 00:48:35 +0000 Subject: [PATCH] Fixed bug in unused parameter check --- analysis/unused.d | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/analysis/unused.d b/analysis/unused.d index 221fb7b..73224c9 100644 --- a/analysis/unused.d +++ b/analysis/unused.d @@ -35,6 +35,7 @@ class UnusedVariableCheck : BaseAnalyzer isOverride = isOverride || (attribute.storageClass !is null && attribute.storageClass.token == tok!"override"); declaration.accept(this); + isOverride = false; } override void visit(const FunctionDeclaration functionDec) @@ -42,9 +43,12 @@ class UnusedVariableCheck : BaseAnalyzer pushScope(); if (functionDec.functionBody !is null) { + bool ias = inAggregateScope; + inAggregateScope = false; if (!isOverride) functionDec.parameters.accept(this); functionDec.functionBody.accept(this); + inAggregateScope = ias; } popScope(); }