diff options
author | Lu Guanqun <guanqun.lu@gmail.com> | 2016-01-11 23:30:25 +0800 |
---|---|---|
committer | Lu Guanqun <guanqun.lu@gmail.com> | 2016-01-23 01:14:01 +0800 |
commit | c8b05339335d8e9166ef6863f7697bcc59f09260 (patch) | |
tree | d1808b0607d8fd8dd1f6b021c57c87be3463698e /libsolidity/analysis/TypeChecker.cpp | |
parent | ac3019298a42e87a2a9182b2a80a019e31d64f88 (diff) | |
download | dexon-solidity-c8b05339335d8e9166ef6863f7697bcc59f09260.tar dexon-solidity-c8b05339335d8e9166ef6863f7697bcc59f09260.tar.gz dexon-solidity-c8b05339335d8e9166ef6863f7697bcc59f09260.tar.bz2 dexon-solidity-c8b05339335d8e9166ef6863f7697bcc59f09260.tar.lz dexon-solidity-c8b05339335d8e9166ef6863f7697bcc59f09260.tar.xz dexon-solidity-c8b05339335d8e9166ef6863f7697bcc59f09260.tar.zst dexon-solidity-c8b05339335d8e9166ef6863f7697bcc59f09260.zip |
[cond-expr] change the end to end test
Diffstat (limited to 'libsolidity/analysis/TypeChecker.cpp')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 8 |
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( |