Fix duplicate stdlib import redefinition

This commit is contained in:
sergeych committed 2026-04-11 19:24:08 +03:00
1 parent a1ea09440d
commit 6171b0d95f
2 files changed
+49 -1

No files matched your search

@@ -94,7 +94,11 @@ class ModuleScope(
if (newName != null) {
val existing = scope.objects[newName]
if (existing != null) {
if (existing.importedFrom != record.importedFrom)
val sameBinding =
existing === record ||
existing.importedFrom == record.importedFrom ||
existing.value === record.value
if (!sameBinding)
scope.raiseError("symbol ${existing.importedFrom?.packageName}.$newName already exists, redefinition on import is not allowed")
// already imported
} else {