From 06b7114ae11780aa22f62d7223f224ee189a633e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Wed, 22 Mar 2023 19:25:04 +0100 Subject: [PATCH] fixup! Tests for suffixes used to define operators --- .../literal_suffix_as_operator_definition.sol | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/libsolidity/semanticTests/operators/userDefined/literal_suffix_as_operator_definition.sol b/test/libsolidity/semanticTests/operators/userDefined/literal_suffix_as_operator_definition.sol index 7852967f4..e20850f44 100644 --- a/test/libsolidity/semanticTests/operators/userDefined/literal_suffix_as_operator_definition.sol +++ b/test/libsolidity/semanticTests/operators/userDefined/literal_suffix_as_operator_definition.sol @@ -2,23 +2,23 @@ type B is bool; using {bitnot as ~, bitor as |} for B global; // NOTE: There are no literals of type B so these cannot be actually used on anything -function bitnot(B x) pure suffix returns (B) { - return B.wrap(!B.unwrap(x)); -} - function bitor(B x, B y) pure suffix returns (B) { return B.wrap(B.unwrap(x) || B.unwrap(y)); } +function bitnot(B x) pure suffix returns (B) { + return B.wrap(!B.unwrap(x)); +} + contract C { function testBinary() pure public returns (B) { - B.wrap(true) | B.wrap(false); + return B.wrap(true) | B.wrap(false); } function testUnary() pure public returns (B) { - -B.wrap(true); + return ~B.wrap(true); } } // ---- -// testUnary() -> true -// testBinary() -> false +// testBinary() -> true +// testUnary() -> false