aboutsummaryrefslogtreecommitdiffstats
path: root/AST.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-11-06 06:35:00 +0800
committerChristian <c@ethdev.com>2014-11-06 06:35:00 +0800
commit0062cdb83c85162335188e9a21ebe85cb807a084 (patch)
treecfd3df180d3049ae8c42b0c15fc8af97f7a75c2a /AST.cpp
parente30d3f8d539882376b29a1fe8f4bf6bcaf8c1762 (diff)
downloaddexon-solidity-0062cdb83c85162335188e9a21ebe85cb807a084.tar.gz
dexon-solidity-0062cdb83c85162335188e9a21ebe85cb807a084.tar.zst
dexon-solidity-0062cdb83c85162335188e9a21ebe85cb807a084.zip
Minor cleanup.
Diffstat (limited to 'AST.cpp')
-rw-r--r--AST.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/AST.cpp b/AST.cpp
index 026aef97..44cf3929 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -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."));
@@ -366,8 +356,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()))
@@ -446,14 +436,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)
{