Merge pull request #11881 from ethereum/unsuable-symbol-11855

Properly export symbols from aliased imports.
This commit is contained in:
chriseth
2021-09-02 16:39:16 +02:00
committed by GitHub
3 changed files with 15 additions and 1 deletions
+1
View File
@@ -14,6 +14,7 @@ Compiler Features:
Bugfixes:
* Name Resolver: Fix that when importing an aliased symbol using ``import {AliasedName} from "a.sol"`` it would use the original name of the symbol and not the aliased one.
* SMTChecker: Fix false negative caused by ``push`` on storage array references returned by internal functions.
* SMTChecker: Fix false positive in external calls from constructors.
* SMTChecker: Fix internal error on some multi-source uses of ``abi.*``, cryptographic functions and constants.
+6 -1
View File
@@ -102,7 +102,12 @@ bool NameAndTypeResolver::performImports(SourceUnit& _sourceUnit, map<string, So
else
for (Declaration const* declaration: declarations)
if (!DeclarationRegistrationHelper::registerDeclaration(
target, *declaration, alias.alias.get(), &alias.location, false, m_errorReporter
target,
*declaration,
alias.alias ? alias.alias.get() : &alias.symbol->name(),
&alias.location,
false,
m_errorReporter
))
error = true;
}
@@ -0,0 +1,8 @@
==== Source: dummy ====
contract Dummy { string public constant FOO = "FOO"; }
==== Source: hasAlias ====
import {Dummy as AliasedDummy} from "dummy";
==== Source: Main ====
import {AliasedDummy} from "hasAlias";
contract TestAlias is AliasedDummy {}
// ----