aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorLu Guanqun <guanqun.lu@gmail.com>2015-12-24 00:12:41 +0800
committerLu Guanqun <guanqun.lu@gmail.com>2016-01-23 01:14:00 +0800
commit9cd96222dae55173d3afc17b3cf7a4701edae156 (patch)
treee5156c6436ffc4e4c922738d5c64b575ed4a8290 /libsolidity
parent4471a2ce3bda9ff802bb9701d042b5c68c312495 (diff)
downloaddexon-solidity-9cd96222dae55173d3afc17b3cf7a4701edae156.tar
dexon-solidity-9cd96222dae55173d3afc17b3cf7a4701edae156.tar.gz
dexon-solidity-9cd96222dae55173d3afc17b3cf7a4701edae156.tar.bz2
dexon-solidity-9cd96222dae55173d3afc17b3cf7a4701edae156.tar.lz
dexon-solidity-9cd96222dae55173d3afc17b3cf7a4701edae156.tar.xz
dexon-solidity-9cd96222dae55173d3afc17b3cf7a4701edae156.tar.zst
dexon-solidity-9cd96222dae55173d3afc17b3cf7a4701edae156.zip
[cond-expr] support conditional expression as lvalue
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 058e879e..416ac1ef 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -769,6 +769,14 @@ void TypeChecker::endVisit(Conditional const& _conditional)
"."
);
_conditional.annotation().type = commonType;
+
+ if (_conditional.annotation().lValueRequested)
+ {
+ requireLValue(_conditional.trueExpression());
+ requireLValue(_conditional.falseExpression());
+
+ _conditional.annotation().isLValue = true;
+ }
}
bool TypeChecker::visit(Assignment const& _assignment)