mirror of
https://github.com/exaloop/codon.git
synced 2025-06-03 15:03:52 +08:00
Fix out-of-module shadowing
This commit is contained in:
parent
a61ed7d164
commit
b853397b34
@ -156,7 +156,7 @@ void SimplifyVisitor::visit(FunctionStmt *stmt) {
|
||||
// Function bindings cannot be dominated either
|
||||
if (!isClassMember) {
|
||||
auto funcVal = ctx->find(stmt->name);
|
||||
if (funcVal && funcVal->noShadow)
|
||||
if (funcVal && funcVal->moduleName == ctx->getModule() && funcVal->noShadow)
|
||||
E(Error::CLASS_INVALID_BIND, stmt, stmt->name);
|
||||
funcVal = ctx->addFunc(stmt->name, rootName, stmt->getSrcInfo());
|
||||
ctx->addAlwaysVisible(funcVal);
|
||||
|
Loading…
x
Reference in New Issue
Block a user