Fixes internal compiler error with an unused reference to module member.

This commit is contained in:
Christian Parpart 2020-10-12 11:56:01 +02:00
parent b0acf5dc86
commit 712d0805eb
3 changed files with 21 additions and 0 deletions

View File

@ -8,6 +8,7 @@ Compiler Features:
Bugfixes:
* Code generator: Fix internal compiler error when referencing members via module name but not using the reference.
* Type Checker: Fix internal compiler error caused by storage parameters with nested mappings in libraries.
* Name Resolver: Fix shadowing/same-name warnings for later declarations.

View File

@ -1772,6 +1772,11 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
solAssert(*_memberAccess.annotation().requiredLookup == VirtualLookup::Static, "");
utils().pushCombinedFunctionEntryLabel(*function);
}
else if (auto const* contract = dynamic_cast<ContractDefinition const*>(_memberAccess.annotation().referencedDeclaration))
{
if (contract->isLibrary())
m_context.appendLibraryAddress(contract->fullyQualifiedName());
}
break;
}
default:

View File

@ -0,0 +1,15 @@
==== Source: s1.sol ====
import "s1.sol" as A;
library L {
function f() internal pure {}
}
contract C
{
function test() public pure {
A.L;
}
}
// ----
// Warning 6133: (s1.sol:127-130): Statement has no effect.