Fixed nested calls

This commit is contained in:
Mattia Giambirtone 2022-06-02 10:19:34 +02:00
parent f2f0fae36f
commit 6b314f2882
2 changed files with 4 additions and 6 deletions

View File

@ -362,11 +362,11 @@ proc getStackPos(self: Compiler, name: IdentExpr, depth: int = self.scopeDepth):
if name.name.lexeme == variable.name.name.lexeme:
if variable.isPrivate and variable.owner != self.currentModule:
continue
elif variable.depth == depth or variable.depth == 0:
if variable.depth == depth or variable.depth == 0:
# variable.depth == 0 for globals!
found = true
break
inc(result)
inc(result)
if not found:
return -1

View File

@ -1,9 +1,7 @@
operator `+`(a: int): int {
operator `-`(a: int): int {
return a;
}
return -a;
return a;
}
+1; # Works: defined for int64
+1'i32; # Will not work