public DefType ExistsVariable(string name, CodeElement elem) { if (Vars.ExistsVariable(name)) { return(Vars.GetVariable(name).ResultType); } else if (ParentScope != null) { return(ParentScope.ExistsVariable(name, elem)); } else { throw new Exception(string.Format("A variable called '{0}', {1}, does not exists", name, elem.GetLineAndColumn())); } }