removed invalid duplicate name check about subroutine parameters

This commit is contained in:
Irmen de Jong 2020-09-19 16:04:04 +02:00
parent f2b069c562
commit f0cd03d14f
2 changed files with 0 additions and 16 deletions

View File

@ -88,14 +88,6 @@ internal class AstIdentifiersChecker(private val program: Program, private val e
if (existing != null && existing !== subroutine)
nameError(subroutine.name, subroutine.position, existing)
// does the parameter redefine a variable declared elsewhere?
for(param in subroutine.parameters) {
val existingVar = subroutine.lookup(listOf(param.name), subroutine)
if (existingVar != null && existingVar.parent !== subroutine) {
nameError(param.name, param.position, existingVar)
}
}
// check that there are no local variables, labels, or other subs that redefine the subroutine's parameters
val symbolsInSub = subroutine.allDefinedSymbols()
val namesInSub = symbolsInSub.map{ it.first }.toSet()

View File

@ -8,14 +8,6 @@
main {
;asmsub clear_screen (ubyte char @ A, ubyte color @ Y) clobbers(A) { ...}
; TODO dont cause name conflict if we define sub or sub with param 'color' or even a var 'color' later.
; sub color(...) {}
; sub other(ubyte color) {} ; TODO don't cause name conflict
sub start() {
}
}