aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorLu Guanqun <guanqun.lu@gmail.com>2016-01-11 23:30:25 +0800
committerLu Guanqun <guanqun.lu@gmail.com>2016-01-23 01:14:01 +0800
commitc8b05339335d8e9166ef6863f7697bcc59f09260 (patch)
treed1808b0607d8fd8dd1f6b021c57c87be3463698e /libsolidity/analysis
parentac3019298a42e87a2a9182b2a80a019e31d64f88 (diff)
downloaddexon-solidity-c8b05339335d8e9166ef6863f7697bcc59f09260.tar.gz
dexon-solidity-c8b05339335d8e9166ef6863f7697bcc59f09260.tar.zst
dexon-solidity-c8b05339335d8e9166ef6863f7697bcc59f09260.zip
[cond-expr] change the end to end test
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index a8125573..016fe66a 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -758,8 +758,12 @@ bool TypeChecker::visit(Conditional const& _conditional)
if (*trueType == *falseType)
commonType = trueType;
else
- // we fake it as an equal operator, but any other comparison operator can work.
- commonType = trueType->binaryOperatorResult(Token::Equal, falseType);
+ {
+ commonType = Type::commonType(trueType, falseType);
+ if (!commonType)
+ // we fake it as an equal operator, but any other comparison operator can work.
+ commonType = trueType->binaryOperatorResult(Token::Equal, falseType);
+ }
if (!commonType)
{
typeError(