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
commit 9c2ab1ff2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

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.

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;
}

View File

@ -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 {}
// ----