diff options
author | Christian <c@ethdev.com> | 2014-11-07 05:07:02 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-11-07 05:07:02 +0800 |
commit | 6c2e3ffd76eaf43f4a309d3316793126ccf72c40 (patch) | |
tree | a0957de01b09b063cc4a6e077faf09658733bbd6 /AST.cpp | |
parent | d3215fb4a697e8e9962bf59f573fab309ab5ac18 (diff) | |
parent | eb894869d49d4be512c73e517f7013717645cbbb (diff) | |
download | dexon-solidity-6c2e3ffd76eaf43f4a309d3316793126ccf72c40.tar dexon-solidity-6c2e3ffd76eaf43f4a309d3316793126ccf72c40.tar.gz dexon-solidity-6c2e3ffd76eaf43f4a309d3316793126ccf72c40.tar.bz2 dexon-solidity-6c2e3ffd76eaf43f4a309d3316793126ccf72c40.tar.lz dexon-solidity-6c2e3ffd76eaf43f4a309d3316793126ccf72c40.tar.xz dexon-solidity-6c2e3ffd76eaf43f4a309d3316793126ccf72c40.tar.zst dexon-solidity-6c2e3ffd76eaf43f4a309d3316793126ccf72c40.zip |
Merge remote-tracking branch 'ethereum/develop' into sol_typePromotion
Diffstat (limited to 'AST.cpp')
-rw-r--r-- | AST.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
@@ -283,14 +283,6 @@ void WhileStatement::checkTypeRequirements() m_body->checkTypeRequirements(); } -void Continue::checkTypeRequirements() -{ -} - -void Break::checkTypeRequirements() -{ -} - void Return::checkTypeRequirements() { if (!m_expression) @@ -326,8 +318,6 @@ void VariableDefinition::checkTypeRequirements() void Assignment::checkTypeRequirements() { - //@todo lefthandside actually has to be assignable - // add a feature to the type system to check that m_leftHandSide->checkTypeRequirements(); if (!m_leftHandSide->isLvalue()) BOOST_THROW_EXCEPTION(createTypeError("Expression has to be an lvalue.")); @@ -368,8 +358,8 @@ void UnaryOperation::checkTypeRequirements() void BinaryOperation::checkTypeRequirements() { - m_right->checkTypeRequirements(); m_left->checkTypeRequirements(); + m_right->checkTypeRequirements(); if (m_right->getType()->isImplicitlyConvertibleTo(*m_left->getType())) m_commonType = m_left->getType(); else if (m_left->getType()->isImplicitlyConvertibleTo(*m_right->getType())) @@ -452,14 +442,6 @@ void Identifier::checkTypeRequirements() if (asserts(m_referencedDeclaration)) BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Identifier not resolved.")); - //@todo these dynamic casts here are not really nice... - // is i useful to have an AST visitor here? - // or can this already be done in NameAndTypeResolver? - // the only problem we get there is that in - // var x; - // x = 2; - // var y = x; - // the type of x is not yet determined. VariableDeclaration* variable = dynamic_cast<VariableDeclaration*>(m_referencedDeclaration); if (variable) { |