Operators imported in one source file shouldn't affect another one.

Previously we would cache the results of operator lookup whether or not the
operator we found came from an imported module. Since different source files
can have different imports, it's not correct to automatically share operators
from imported modules with all files in the translation unit.

This still isn't fully correct; the current logic prefers operators from
local imports over operators implicitly available from other source files.

Swift SVN r9683
This commit is contained in:
Jordan Rose
2013-10-25 22:21:14 +00:00
parent ec4234bdbc
commit fc88c5dae6
7 changed files with 103 additions and 53 deletions

View File

@@ -533,6 +533,8 @@ OperatorDecl *ModuleFile::lookupOperator(Identifier name, DeclKind fixity) {
return cast<OperatorDecl>(getDecl(item.second));
}
// FIXME: operators re-exported from other modules?
return nullptr;
}