diff --git a/Changelog.md b/Changelog.md index 1bbf51ff2..d5945cec5 100644 --- a/Changelog.md +++ b/Changelog.md @@ -13,6 +13,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. diff --git a/libsolidity/analysis/NameAndTypeResolver.cpp b/libsolidity/analysis/NameAndTypeResolver.cpp index 20c4f2c46..001221bc5 100644 --- a/libsolidity/analysis/NameAndTypeResolver.cpp +++ b/libsolidity/analysis/NameAndTypeResolver.cpp @@ -102,7 +102,12 @@ bool NameAndTypeResolver::performImports(SourceUnit& _sourceUnit, mapname(), + &alias.location, + false, + m_errorReporter )) error = true; } diff --git a/test/libsolidity/syntaxTests/imports/alias_import_not_forwarded.sol b/test/libsolidity/syntaxTests/imports/alias_import_not_forwarded.sol new file mode 100644 index 000000000..1a7bb40fe --- /dev/null +++ b/test/libsolidity/syntaxTests/imports/alias_import_not_forwarded.sol @@ -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 {} +// ----