aboutsummaryrefslogtreecommitdiffstats
path: root/ExpressionCompiler.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-11-21 01:33:23 +0800
committerChristian <c@ethdev.com>2014-11-24 04:28:44 +0800
commitc50cd646ce3b8b6c20da747efee89f9420526cae (patch)
treea6ebf3a1fe6088d9b8c5e3d4f36caa09bfd3fdd7 /ExpressionCompiler.cpp
parentfa987e0a206bba35cfe6e311f8bad1470d9b5d4f (diff)
downloaddexon-solidity-c50cd646ce3b8b6c20da747efee89f9420526cae.tar.gz
dexon-solidity-c50cd646ce3b8b6c20da747efee89f9420526cae.tar.zst
dexon-solidity-c50cd646ce3b8b6c20da747efee89f9420526cae.zip
Contracts as types and framework for special global variables.
Diffstat (limited to 'ExpressionCompiler.cpp')
-rw-r--r--ExpressionCompiler.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp
index 89eeb31f..4d175527 100644
--- a/ExpressionCompiler.cpp
+++ b/ExpressionCompiler.cpp
@@ -167,7 +167,15 @@ bool ExpressionCompiler::visit(FunctionCall& _functionCall)
BOOST_THROW_EXCEPTION(InternalCompilerError());
Expression& firstArgument = *_functionCall.getArguments().front();
firstArgument.accept(*this);
- appendTypeConversion(*firstArgument.getType(), *_functionCall.getType());
+ if (firstArgument.getType()->getCategory() == Type::Category::CONTRACT &&
+ _functionCall.getType()->getCategory() == Type::Category::INTEGER)
+ {
+ // explicit type conversion contract -> address, nothing to do.
+ }
+ else
+ {
+ appendTypeConversion(*firstArgument.getType(), *_functionCall.getType());
+ }
}
else
{
@@ -466,7 +474,7 @@ void ExpressionCompiler::LValue::storeValue(Expression const& _expression, bool
}
}
-void ExpressionCompiler::LValue::retrieveValueIfLValueNotRequested(const Expression& _expression)
+void ExpressionCompiler::LValue::retrieveValueIfLValueNotRequested(Expression const& _expression)
{
if (!_expression.lvalueRequested())
{
@@ -475,7 +483,7 @@ void ExpressionCompiler::LValue::retrieveValueIfLValueNotRequested(const Express
}
}
-void ExpressionCompiler::LValue::fromDeclaration( Expression const& _expression, Declaration const& _declaration)
+void ExpressionCompiler::LValue::fromDeclaration(Expression const& _expression, Declaration const& _declaration)
{
if (m_context->isLocalVariable(&_declaration))
{