aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-05-30 13:16:35 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-05-30 13:16:35 +0800
commit6eedc6e7977a34c0d498567347937454044e76ff (patch)
tree9b327f315db6fce345c20ddeec553342e98eaf21 /test
parent8f04c59046595216e9fffd93435055aa864fbd1f (diff)
downloaddexon-solidity-6eedc6e7977a34c0d498567347937454044e76ff.tar.gz
dexon-solidity-6eedc6e7977a34c0d498567347937454044e76ff.tar.zst
dexon-solidity-6eedc6e7977a34c0d498567347937454044e76ff.zip
Extend function type comparison test
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index ab7cfb12..760139c1 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -293,6 +293,22 @@ BOOST_AUTO_TEST_CASE(comparison_of_function_types)
text = R"(
contract C {
function f() public returns (bool ret) {
+ return this.f > this.f;
+ }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Operator > not compatible");
+ text = R"(
+ contract C {
+ function f() public returns (bool ret) {
+ return f > f;
+ }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Operator > not compatible");
+ text = R"(
+ contract C {
+ function f() public returns (bool ret) {
return f == f;
}
function g() public returns (bool ret) {