Bound functions.

This commit is contained in:
chriseth
2020-11-23 18:58:23 +01:00
parent b62de4f16d
commit f87edb6efc
11 changed files with 96 additions and 24 deletions
+6 -2
View File
@@ -3017,6 +3017,11 @@ TypePointers FunctionType::parameterTypes() const
return TypePointers(m_parameterTypes.cbegin() + 1, m_parameterTypes.cend());
}
TypePointers const& FunctionType::parameterTypesIncludingSelf() const
{
return m_parameterTypes;
}
string FunctionType::richIdentifier() const
{
string id = "t_function_";
@@ -3267,8 +3272,7 @@ vector<tuple<string, TypePointer>> FunctionType::makeStackItems() const
if (m_saltSet)
slots.emplace_back("salt", TypeProvider::fixedBytes(32));
if (bound())
for (auto const& [boundName, boundType]: m_parameterTypes.front()->stackItems())
slots.emplace_back("self_" + boundName, boundType);
slots.emplace_back("self", m_parameterTypes.front());
return slots;
}