Modules are pure.

This commit is contained in:
chriseth
2020-06-18 18:28:04 +02:00
parent b1d22ab2c8
commit cd2cc76f20
4 changed files with 47 additions and 1 deletions
@@ -1718,6 +1718,16 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
solAssert(false, "Illegal fixed bytes member.");
break;
}
case Type::Category::Module:
{
Type::Category category = _memberAccess.annotation().type->category();
solAssert(
category == Type::Category::TypeType ||
category == Type::Category::Module,
""
);
break;
}
default:
solAssert(false, "Member access to unknown type.");
}
@@ -1933,6 +1943,10 @@ void ExpressionCompiler::endVisit(Identifier const& _identifier)
{
// no-op
}
else if (dynamic_cast<ImportDirective const*>(declaration))
{
// no-op
}
else
{
solAssert(false, "Identifier type not expected in expression context.");