aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-10 06:10:40 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-08-11 00:03:45 +0800
commit1b32cdcf21d284eec68c298b81d1c3b02a137ab3 (patch)
treebfb911ede8406ff5a38e809f52e3f4d6c7d583be /libsolidity
parentabe6eb983073d5a8e6d5ac469e4c437ea421c79d (diff)
downloaddexon-solidity-1b32cdcf21d284eec68c298b81d1c3b02a137ab3.tar.gz
dexon-solidity-1b32cdcf21d284eec68c298b81d1c3b02a137ab3.tar.zst
dexon-solidity-1b32cdcf21d284eec68c298b81d1c3b02a137ab3.zip
Check for payable when comparing function types
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/ast/Types.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp
index cf43d3fe..892814ba 100644
--- a/libsolidity/ast/Types.cpp
+++ b/libsolidity/ast/Types.cpp
@@ -2220,6 +2220,8 @@ string FunctionType::identifier() const
}
if (isConstant())
id += "_constant";
+ if (isPayable())
+ id += "_payable";
id += identifierList(m_parameterTypes) + "returns" + identifierList(m_returnParameterTypes);
if (m_gasSet)
id += "gas";
@@ -2238,9 +2240,13 @@ bool FunctionType::operator==(Type const& _other) const
if (m_kind != other.m_kind)
return false;
+
if (m_isConstant != other.isConstant())
return false;
+ if (m_isPayable != other.isPayable())
+ return false;
+
if (m_parameterTypes.size() != other.m_parameterTypes.size() ||
m_returnParameterTypes.size() != other.m_returnParameterTypes.size())
return false;
@@ -2399,10 +2405,15 @@ FunctionTypePointer FunctionType::interfaceFunctionType() const
return FunctionTypePointer();
return make_shared<FunctionType>(
- paramTypes, retParamTypes,
- m_parameterNames, m_returnParameterNames,
- m_kind, m_arbitraryParameters,
- m_declaration, m_isConstant, m_isPayable
+ paramTypes,
+ retParamTypes,
+ m_parameterNames,
+ m_returnParameterNames,
+ m_kind,
+ m_arbitraryParameters,
+ m_declaration,
+ m_isConstant,
+ m_isPayable
);
}