From: Florian Deljarry Date: Fri, 19 Apr 2019 21:32:27 +0000 (-0400) Subject: scope: Adding variable verification X-Git-Url: http://nitlanguage.org scope: Adding variable verification If the variable already exists it will be used Signed-off-by: Florian Deljarry --- diff --git a/src/semantize/scope.nit b/src/semantize/scope.nit index 3374951..7d9d5c8 100644 --- a/src/semantize/scope.nit +++ b/src/semantize/scope.nit @@ -268,6 +268,11 @@ redef class AParam var variable: nullable Variable redef fun accept_scope_visitor(v) do + if variable != null then + v.register_variable(self.n_id, variable.as(not null)) + return + end + super var nid = self.n_id var variable = new Variable(nid.text)