From d384216b42d1db42f050443f28993cae078883e7 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sat, 11 May 2024 02:02:49 +0200 Subject: [PATCH] Fix shadowing warning --- src/classes/validationschema.gd | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/classes/validationschema.gd b/src/classes/validationschema.gd index 2925522..c1ce8c0 100644 --- a/src/classes/validationschema.gd +++ b/src/classes/validationschema.gd @@ -42,21 +42,21 @@ func _init(core_new: Core, schema_new: Dictionary, data_new: Dictionary, parent_ # Check Dictionary _check_dictionary_recursive(schema) -func _check_dictionary_recursive(parent: Dictionary, path: String = "") -> bool: +func _check_dictionary_recursive(parent_dict: Dictionary, path: String = "") -> bool: var success: bool = false - for key in parent: + for key in parent_dict: if typeof(key) != TYPE_STRING: logger.error(core.stringify_variables("Could not parse schema: Schema key %key% is not of type String", { "key": path + "/" + key })) success = false continue - match(typeof(parent[key])): + match(typeof(parent_dict[key])): TYPE_OBJECT: - if parent[key].get_class() != "Node": + if parent_dict[key].get_class() != "Node": logger.error(core.stringify_variables("Could not parse schema: Schema value of %key% is not of type Node", { "key": path + "/" + key })) success = false continue TYPE_DICTIONARY: - _check_dictionary_recursive(parent[key], path + "/" + key) + _check_dictionary_recursive(parent_dict[key], path + "/" + key) _: logger.error(core.stringify_variables("Could not parse schema: Schema value of %key% is not of type CoreValidationSingle or Dictionary", { "key": path + "/" + key })) success = false @@ -71,9 +71,9 @@ func evaluate() -> Array[String]: return failed -func _evaluate_recursive(random: String, parent: Dictionary, path: String = "") -> Array[String]: +func _evaluate_recursive(random: String, parent_dict: Dictionary, path: String = "") -> Array[String]: var failed: Array[String] = [] - for key in parent: + for key in parent_dict: # Check if key exists in data if data.get(key, random) == random: # Does not exist, append error