aboutsummaryrefslogtreecommitdiffstats
path: root/AST.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-11-07 05:07:02 +0800
committerChristian <c@ethdev.com>2014-11-07 05:07:02 +0800
commit6c2e3ffd76eaf43f4a309d3316793126ccf72c40 (patch)
treea0957de01b09b063cc4a6e077faf09658733bbd6 /AST.cpp
parentd3215fb4a697e8e9962bf59f573fab309ab5ac18 (diff)
parenteb894869d49d4be512c73e517f7013717645cbbb (diff)
downloaddexon-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.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/AST.cpp b/AST.cpp
index e146318c..565560ad 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."));
@@ -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)
{