diff --git a/compiler/src/prog8/ast/processing/AstIdentifiersChecker.kt b/compiler/src/prog8/ast/processing/AstIdentifiersChecker.kt index 0023bc422..e6b4f7a3b 100644 --- a/compiler/src/prog8/ast/processing/AstIdentifiersChecker.kt +++ b/compiler/src/prog8/ast/processing/AstIdentifiersChecker.kt @@ -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() diff --git a/examples/test.p8 b/examples/test.p8 index f21204f2e..4ae589a67 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -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() { - } }