aboutsummaryrefslogtreecommitdiffstats
path: root/AST.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-01-15 01:22:16 +0800
committerchriseth <c@ethdev.com>2015-01-15 01:22:16 +0800
commit1a4280de35d118493e11bc8272d2d7127adaa50c (patch)
tree6abcbc41d1ded067d5ffd8453656241366512217 /AST.cpp
parent6e16107870494878635da347146b076a7d75dea0 (diff)
parentabe6055ab73d643ae904202850e4502596112e20 (diff)
downloaddexon-solidity-1a4280de35d118493e11bc8272d2d7127adaa50c.tar.gz
dexon-solidity-1a4280de35d118493e11bc8272d2d7127adaa50c.tar.zst
dexon-solidity-1a4280de35d118493e11bc8272d2d7127adaa50c.zip
Merge pull request #799 from chriseth/sol_gasAndValue
Specify gas and value for function calls and contract creation calls.
Diffstat (limited to 'AST.cpp')
-rw-r--r--AST.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/AST.cpp b/AST.cpp
index ea8ecdb7..7b633564 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -331,20 +331,13 @@ bool FunctionCall::isTypeConversion() const
void NewExpression::checkTypeRequirements()
{
m_contractName->checkTypeRequirements();
- for (ASTPointer<Expression> const& argument: m_arguments)
- argument->checkTypeRequirements();
-
m_contract = dynamic_cast<ContractDefinition const*>(m_contractName->getReferencedDeclaration());
if (!m_contract)
BOOST_THROW_EXCEPTION(createTypeError("Identifier is not a contract."));
- shared_ptr<ContractType const> type = make_shared<ContractType>(*m_contract);
- m_type = type;
- TypePointers const& parameterTypes = type->getConstructorType()->getParameterTypes();
- if (parameterTypes.size() != m_arguments.size())
- BOOST_THROW_EXCEPTION(createTypeError("Wrong argument count for constructor call."));
- for (size_t i = 0; i < m_arguments.size(); ++i)
- if (!m_arguments[i]->getType()->isImplicitlyConvertibleTo(*parameterTypes[i]))
- BOOST_THROW_EXCEPTION(createTypeError("Invalid type for argument in constructor call."));
+ shared_ptr<ContractType const> contractType = make_shared<ContractType>(*m_contract);
+ TypePointers const& parameterTypes = contractType->getConstructorType()->getParameterTypes();
+ m_type = make_shared<FunctionType>(parameterTypes, TypePointers{contractType},
+ FunctionType::Location::CREATION);
}
void MemberAccess::checkTypeRequirements()