Skip to content

Instantly share code, notes, and snippets.

@bshastry
Created November 3, 2018 15:50
Show Gist options
  • Save bshastry/f9d7c7104c79954fc2d38d8c050620b0 to your computer and use it in GitHub Desktop.
Save bshastry/f9d7c7104c79954fc2d38d8c050620b0 to your computer and use it in GitHub Desktop.
Solidity failing assertion
bool StructType::canBeUsedExternally(bool _inLibrary) const
{
if (_inLibrary && location() == DataLocation::Storage)
return true;
else if (recursive())
return false;
else
{
// Check that all members have interface types.
// We pass "false" to canBeUsedExternally (_inLibrary), because this struct will be
// passed by value and thus the encoding does not differ, but it will disallow
// mappings.
for (auto const& var: m_struct.members())
{
solAssert(var->annotation().type, "");
if (!var->annotation().type->canBeUsedExternally(false))
return false;
}
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment