Skip to content

Commit 830a029

Browse files
Contract type comparison deprecation warning
1 parent 41c9256 commit 830a029

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

libsolidity/analysis/TypeChecker.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,6 +1829,16 @@ void TypeChecker::endVisit(BinaryOperation const& _operation)
18291829
)
18301830
);
18311831
}
1832+
if (
1833+
TokenTraits::isCompareOp(_operation.getOperator()) &&
1834+
commonType->category() == Type::Category::Contract
1835+
)
1836+
m_errorReporter.warning(
1837+
9170_error,
1838+
_operation.location(),
1839+
"Comparison of variables of contract type is deprecated and scheduled for removal "
1840+
"in the next breaking version (0.9). Instead, use an explicit cast to address type."
1841+
);
18321842
}
18331843

18341844
Type const* TypeChecker::typeCheckTypeConversionAndRetrieveReturnType(

0 commit comments

Comments
 (0)