aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2015-02-10 17:45:57 +0800
committerChristian <c@ethdev.com>2015-02-10 17:59:23 +0800
commitcf4144b70246b53589b3238213f688244485f9b0 (patch)
treedeb3cb5c3b8c8ebd3424338c727a1af6e84309cf /Types.cpp
parentbb6f181d7dacfd1d7a070483500937004bea995c (diff)
downloaddexon-solidity-cf4144b70246b53589b3238213f688244485f9b0.tar.gz
dexon-solidity-cf4144b70246b53589b3238213f688244485f9b0.tar.zst
dexon-solidity-cf4144b70246b53589b3238213f688244485f9b0.zip
Arbitrary parameters for call() and all hash functions.
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/Types.cpp b/Types.cpp
index 02c293b7..6fd9e8b4 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -210,10 +210,7 @@ TypePointer IntegerType::binaryOperatorResult(Token::Value _operator, TypePointe
const MemberList IntegerType::AddressMemberList =
MemberList({{"balance", make_shared<IntegerType >(256)},
- {"callstring32", make_shared<FunctionType>(strings{"string32"}, strings{},
- FunctionType::Location::Bare)},
- {"callstring32string32", make_shared<FunctionType>(strings{"string32", "string32"},
- strings{}, FunctionType::Location::Bare)},
+ {"call", make_shared<FunctionType>(strings(), strings(), FunctionType::Location::Bare, true)},
{"send", make_shared<FunctionType>(strings{"uint"}, strings{}, FunctionType::Location::Send)}});
IntegerConstantType::IntegerConstantType(Literal const& _literal)
@@ -401,13 +398,16 @@ bool StaticStringType::isImplicitlyConvertibleTo(Type const& _convertTo) const
bool StaticStringType::isExplicitlyConvertibleTo(Type const& _convertTo) const
{
+ if (_convertTo.getCategory() == getCategory())
+ return true;
if (_convertTo.getCategory() == Category::Integer)
{
IntegerType const& convertTo = dynamic_cast<IntegerType const&>(_convertTo);
if (convertTo.isHash() && (m_bytes * 8 == convertTo.getNumBits()))
return true;
}
- return isImplicitlyConvertibleTo(_convertTo);
+
+ return false;
}
bool StaticStringType::operator==(Type const& _other) const
@@ -766,10 +766,10 @@ MemberList const& FunctionType::getMembers() const
map<string, TypePointer> members{
{"gas", make_shared<FunctionType>(parseElementaryTypeVector({"uint"}),
TypePointers{copyAndSetGasOrValue(true, false)},
- Location::SetGas, m_gasSet, m_valueSet)},
+ Location::SetGas, false, m_gasSet, m_valueSet)},
{"value", make_shared<FunctionType>(parseElementaryTypeVector({"uint"}),
TypePointers{copyAndSetGasOrValue(false, true)},
- Location::SetValue, m_gasSet, m_valueSet)}};
+ Location::SetValue, false, m_gasSet, m_valueSet)}};
if (m_location == Location::Creation)
members.erase("gas");
m_members.reset(new MemberList(members));
@@ -808,6 +808,7 @@ TypePointers FunctionType::parseElementaryTypeVector(strings const& _types)
TypePointer FunctionType::copyAndSetGasOrValue(bool _setGas, bool _setValue) const
{
return make_shared<FunctionType>(m_parameterTypes, m_returnParameterTypes, m_location,
+ m_arbitraryParameters,
m_gasSet || _setGas, m_valueSet || _setValue);
}
* gettext upgrade uber-patch (stage 3)Ade Lovett2002-04-132-2/+4 * Stage 1 of gettext update.Ade Lovett2002-03-162-2/+2 * Add WWW.Dmitry Sivachenko2001-12-28