mirror of
https://github.com/KarolS/millfork.git
synced 2025-01-09 13:31:32 +00:00
Fix detection of local duplicate names
This commit is contained in:
parent
56c1ab008d
commit
769f410767
@ -511,8 +511,14 @@ class Environment(val parent: Option[Environment], val prefix: String, val cpuFa
|
||||
if (builtinsAdded && Environment.keywords(name)) {
|
||||
log.error(s"Cannot redefine a builtin keyword `$name`", position)
|
||||
false
|
||||
} else if (things.contains(name) || parent.exists(_.things.contains(name))) {
|
||||
} else if (things.contains(name) || parent.exists(_.things.contains(name)) || things.contains(name.stripPrefix(prefix))) {
|
||||
if (!name.contains('.')){
|
||||
if (parent.isDefined) {
|
||||
log.error(s"`${name.stripPrefix(prefix)}` is already defined in this function", position)
|
||||
} else {
|
||||
log.error(s"`$name` is already defined", position)
|
||||
}
|
||||
}
|
||||
false
|
||||
} else {
|
||||
true
|
||||
|
Loading…
Reference in New Issue
Block a user