Disallow comparisons between some types.

This commit is contained in:
chriseth
2017-06-26 16:30:36 +02:00
parent d2445dfdce
commit f47e6e90fb
4 changed files with 16 additions and 5 deletions
+10
View File
@@ -2248,6 +2248,16 @@ TypePointer FunctionType::unaryOperatorResult(Token::Value _operator) const
return TypePointer();
}
TypePointer FunctionType::binaryOperatorResult(Token::Value _operator, TypePointer const& _other) const
{
if (_other->category() != category() || !Token::isCompareOp(_operator))
return TypePointer();
FunctionType const& other = dynamic_cast<FunctionType const&>(*_other);
if (kind() == Kind::Internal && other.kind() == Kind::Internal && sizeOnStack() == 1 && other.sizeOnStack() == 1)
return commonType(shared_from_this(), _other);
return TypePointer();
}
string FunctionType::canonicalName(bool) const
{
solAssert(m_kind == Kind::External, "");