Commit 1fc75e6f authored by Daniel Honsel's avatar Daniel Honsel
Browse files

checkNoUnusedLocalDefinitions: do not consider variables defined in components

parent d189e0f8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1202,9 +1202,10 @@ class CodeStyleValidator extends AbstractDeclarativeValidator {
	}	

	private def checkNoUnusedLocalDefinitionsAll(TTCN3Reference variable) {
		val component = variable.findDesiredParent(ComponentDef)
		val parentControl = variable.findDesiredParent(ModuleControlBody)
		val parent = variable.variableLocal
		if (parent != null || parentControl != null) {
		if (component == null && (parent != null || parentControl != null)) {
			val module = variable.findDesiredParent(TTCN3Module)
			if (variable.isUnreferenced(module, false)) {
				statistics.incrementCountStyle