diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index accd37724..3dc31d0d9 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1808,25 +1808,11 @@ void TypeChecker::endVisit(BinaryOperation const& _operation) (!userDefinedFunctionType || userDefinedFunctionType->isPure()); TypeResult builtinResult = leftType->binaryOperatorResult(_operation.getOperator(), rightType); - Type const* commonType = leftType; // Either the operator is user-defined or built-in. solAssert(!userDefinedOperatorResult || !builtinResult); - if (!builtinResult && !userDefinedOperatorResult) - m_errorReporter.typeError( - 2271_error, - _operation.location(), - "Binary operator " + - string(TokenTraits::toString(_operation.getOperator())) + - " not compatible with types " + - leftType->humanReadableName() + - " and " + - rightType->humanReadableName() + "." + - (!builtinResult.message().empty() ? " " + builtinResult.message() : "") + - (!userDefinedOperatorResult.message().empty() ? " " + userDefinedOperatorResult.message() : "") - ); - + Type const* commonType = leftType; if (builtinResult) commonType = builtinResult.get(); else if (userDefinedOperatorResult) @@ -1861,6 +1847,19 @@ void TypeChecker::endVisit(BinaryOperation const& _operation) else if (userDefinedFunctionType->returnParameterTypes().size() == 1) commonType = userDefinedFunctionType->parameterTypes().at(0); } + else + m_errorReporter.typeError( + 2271_error, + _operation.location(), + "Built-in binary operator " + + string(TokenTraits::toString(_operation.getOperator())) + + " cannot be applied to types " + + leftType->humanReadableName() + + " and " + + rightType->humanReadableName() + "." + + (!builtinResult.message().empty() ? " " + builtinResult.message() : "") + + (!userDefinedOperatorResult.message().empty() ? " " + userDefinedOperatorResult.message() : "") + ); _operation.annotation().commonType = commonType; _operation.annotation().type = diff --git a/test/libsolidity/syntaxTests/abiEncoder/abi_encodeCall_tuple_from_invalid_operator.sol b/test/libsolidity/syntaxTests/abiEncoder/abi_encodeCall_tuple_from_invalid_operator.sol index 5c779d8f0..f6035dd0a 100644 --- a/test/libsolidity/syntaxTests/abiEncoder/abi_encodeCall_tuple_from_invalid_operator.sol +++ b/test/libsolidity/syntaxTests/abiEncoder/abi_encodeCall_tuple_from_invalid_operator.sol @@ -15,9 +15,9 @@ contract C { } } // ---- -// TypeError 2271: (284-299): Binary operator + not compatible with types tuple(int_const 1,int_const 1) and tuple(int_const 2,int_const 2). +// TypeError 2271: (284-299): Built-in binary operator + cannot be applied to types tuple(int_const 1,int_const 1) and tuple(int_const 2,int_const 2). // TypeError 9062: (284-299): Expected an inline tuple, not an expression of a tuple type. -// TypeError 2271: (334-345): Binary operator / not compatible with types tuple() and tuple(). +// TypeError 2271: (334-345): Built-in binary operator / cannot be applied to types tuple() and tuple(). // TypeError 9062: (334-345): Expected an inline tuple, not an expression of a tuple type. // TypeError 4907: (380-383): Built-in unary operator ! cannot be applied to type tuple(). // TypeError 9062: (380-383): Expected an inline tuple, not an expression of a tuple type. diff --git a/test/libsolidity/syntaxTests/conversion/implicit_conversion_of_super_in_comparison.sol b/test/libsolidity/syntaxTests/conversion/implicit_conversion_of_super_in_comparison.sol index 8a535f628..708713b6b 100644 --- a/test/libsolidity/syntaxTests/conversion/implicit_conversion_of_super_in_comparison.sol +++ b/test/libsolidity/syntaxTests/conversion/implicit_conversion_of_super_in_comparison.sol @@ -19,9 +19,9 @@ contract C { } } // ---- -// TypeError 2271: (144-157): Binary operator != not compatible with types type(contract super C) and contract C. -// TypeError 2271: (167-180): Binary operator != not compatible with types contract C and type(contract super C). -// TypeError 2271: (254-264): Binary operator != not compatible with types type(contract super C) and contract C. -// TypeError 2271: (274-284): Binary operator != not compatible with types contract C and type(contract super C). -// TypeError 2271: (349-359): Binary operator != not compatible with types type(contract super C) and contract D. -// TypeError 2271: (369-379): Binary operator != not compatible with types contract D and type(contract super C). +// TypeError 2271: (144-157): Built-in binary operator != cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (167-180): Built-in binary operator != cannot be applied to types contract C and type(contract super C). +// TypeError 2271: (254-264): Built-in binary operator != cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (274-284): Built-in binary operator != cannot be applied to types contract C and type(contract super C). +// TypeError 2271: (349-359): Built-in binary operator != cannot be applied to types type(contract super C) and contract D. +// TypeError 2271: (369-379): Built-in binary operator != cannot be applied to types contract D and type(contract super C). diff --git a/test/libsolidity/syntaxTests/conversion/implicit_conversion_of_super_in_operators.sol b/test/libsolidity/syntaxTests/conversion/implicit_conversion_of_super_in_operators.sol index 284885f8c..40e9075e1 100644 --- a/test/libsolidity/syntaxTests/conversion/implicit_conversion_of_super_in_operators.sol +++ b/test/libsolidity/syntaxTests/conversion/implicit_conversion_of_super_in_operators.sol @@ -30,25 +30,25 @@ contract C { } } // ---- -// TypeError 2271: (49-62): Binary operator << not compatible with types type(contract super C) and contract C. -// TypeError 2271: (72-85): Binary operator >> not compatible with types type(contract super C) and contract C. -// TypeError 2271: (95-107): Binary operator ^ not compatible with types type(contract super C) and contract C. -// TypeError 2271: (117-129): Binary operator | not compatible with types type(contract super C) and contract C. -// TypeError 2271: (139-151): Binary operator & not compatible with types type(contract super C) and contract C. -// TypeError 2271: (162-174): Binary operator * not compatible with types type(contract super C) and contract C. -// TypeError 2271: (184-196): Binary operator / not compatible with types type(contract super C) and contract C. -// TypeError 2271: (206-218): Binary operator % not compatible with types type(contract super C) and contract C. -// TypeError 2271: (228-240): Binary operator - not compatible with types type(contract super C) and contract C. -// TypeError 2271: (250-262): Binary operator + not compatible with types type(contract super C) and contract C. -// TypeError 2271: (272-285): Binary operator ** not compatible with types type(contract super C) and contract C. -// TypeError 2271: (296-309): Binary operator == not compatible with types type(contract super C) and contract C. -// TypeError 2271: (319-332): Binary operator != not compatible with types type(contract super C) and contract C. -// TypeError 2271: (342-355): Binary operator >= not compatible with types type(contract super C) and contract C. -// TypeError 2271: (365-378): Binary operator <= not compatible with types type(contract super C) and contract C. -// TypeError 2271: (388-400): Binary operator < not compatible with types type(contract super C) and contract C. -// TypeError 2271: (410-422): Binary operator > not compatible with types type(contract super C) and contract C. -// TypeError 2271: (433-446): Binary operator || not compatible with types type(contract super C) and contract C. -// TypeError 2271: (456-469): Binary operator && not compatible with types type(contract super C) and contract C. +// TypeError 2271: (49-62): Built-in binary operator << cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (72-85): Built-in binary operator >> cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (95-107): Built-in binary operator ^ cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (117-129): Built-in binary operator | cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (139-151): Built-in binary operator & cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (162-174): Built-in binary operator * cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (184-196): Built-in binary operator / cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (206-218): Built-in binary operator % cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (228-240): Built-in binary operator - cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (250-262): Built-in binary operator + cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (272-285): Built-in binary operator ** cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (296-309): Built-in binary operator == cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (319-332): Built-in binary operator != cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (342-355): Built-in binary operator >= cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (365-378): Built-in binary operator <= cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (388-400): Built-in binary operator < cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (410-422): Built-in binary operator > cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (433-446): Built-in binary operator || cannot be applied to types type(contract super C) and contract C. +// TypeError 2271: (456-469): Built-in binary operator && cannot be applied to types type(contract super C) and contract C. // TypeError 4247: (480-485): Expression has to be an lvalue. // TypeError 7366: (480-493): Operator -= not compatible with types type(contract super C) and contract C. // TypeError 4247: (503-508): Expression has to be an lvalue. diff --git a/test/libsolidity/syntaxTests/errors/error_incompatible_binary_ops.sol b/test/libsolidity/syntaxTests/errors/error_incompatible_binary_ops.sol index 4e63419bf..3a54c1c15 100644 --- a/test/libsolidity/syntaxTests/errors/error_incompatible_binary_ops.sol +++ b/test/libsolidity/syntaxTests/errors/error_incompatible_binary_ops.sol @@ -27,21 +27,21 @@ contract C { } // ---- -// TypeError 2271: (86-116): Binary operator << not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (126-156): Binary operator >> not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (166-195): Binary operator ^ not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (205-234): Binary operator | not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (244-273): Binary operator & not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (284-313): Binary operator * not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (323-352): Binary operator / not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (362-391): Binary operator % not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (401-430): Binary operator + not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (440-469): Binary operator - not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (480-510): Binary operator == not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (520-550): Binary operator != not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (560-590): Binary operator >= not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (600-630): Binary operator <= not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (640-669): Binary operator < not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (679-708): Binary operator > not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (719-749): Binary operator || not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (759-789): Binary operator && not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (86-116): Built-in binary operator << cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (126-156): Built-in binary operator >> cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (166-195): Built-in binary operator ^ cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (205-234): Built-in binary operator | cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (244-273): Built-in binary operator & cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (284-313): Built-in binary operator * cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (323-352): Built-in binary operator / cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (362-391): Built-in binary operator % cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (401-430): Built-in binary operator + cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (440-469): Built-in binary operator - cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (480-510): Built-in binary operator == cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (520-550): Built-in binary operator != cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (560-590): Built-in binary operator >= cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (600-630): Built-in binary operator <= cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (640-669): Built-in binary operator < cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (679-708): Built-in binary operator > cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (719-749): Built-in binary operator || cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). +// TypeError 2271: (759-789): Built-in binary operator && cannot be applied to types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). diff --git a/test/libsolidity/syntaxTests/events/event_incompatible_binary_ops.sol b/test/libsolidity/syntaxTests/events/event_incompatible_binary_ops.sol index b51dc921c..bf04c6a3b 100644 --- a/test/libsolidity/syntaxTests/events/event_incompatible_binary_ops.sol +++ b/test/libsolidity/syntaxTests/events/event_incompatible_binary_ops.sol @@ -26,21 +26,21 @@ contract C { } // ---- -// TypeError 2271: (83-113): Binary operator << not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (123-153): Binary operator >> not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (163-192): Binary operator ^ not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (202-231): Binary operator | not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (241-270): Binary operator & not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (281-310): Binary operator * not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (320-349): Binary operator / not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (359-388): Binary operator % not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (398-427): Binary operator + not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (437-466): Binary operator - not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (477-507): Binary operator == not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (517-547): Binary operator != not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (557-587): Binary operator >= not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (597-627): Binary operator <= not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (637-666): Binary operator < not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (676-705): Binary operator > not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (716-746): Binary operator || not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (756-786): Binary operator && not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (83-113): Built-in binary operator << cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (123-153): Built-in binary operator >> cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (163-192): Built-in binary operator ^ cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (202-231): Built-in binary operator | cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (241-270): Built-in binary operator & cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (281-310): Built-in binary operator * cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (320-349): Built-in binary operator / cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (359-388): Built-in binary operator % cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (398-427): Built-in binary operator + cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (437-466): Built-in binary operator - cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (477-507): Built-in binary operator == cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (517-547): Built-in binary operator != cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (557-587): Built-in binary operator >= cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (597-627): Built-in binary operator <= cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (637-666): Built-in binary operator < cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (676-705): Built-in binary operator > cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (716-746): Built-in binary operator || cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). +// TypeError 2271: (756-786): Built-in binary operator && cannot be applied to types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). diff --git a/test/libsolidity/syntaxTests/functionTypes/comparison_of_function_types_gt_1.sol b/test/libsolidity/syntaxTests/functionTypes/comparison_of_function_types_gt_1.sol index 3b7e0694e..b88c257ae 100644 --- a/test/libsolidity/syntaxTests/functionTypes/comparison_of_function_types_gt_1.sol +++ b/test/libsolidity/syntaxTests/functionTypes/comparison_of_function_types_gt_1.sol @@ -4,4 +4,4 @@ contract C { } } // ---- -// TypeError 2271: (73-88): Binary operator > not compatible with types function () external returns (bool) and function () external returns (bool). +// TypeError 2271: (73-88): Built-in binary operator > cannot be applied to types function () external returns (bool) and function () external returns (bool). diff --git a/test/libsolidity/syntaxTests/functionTypes/comparison_of_function_types_gt_2.sol b/test/libsolidity/syntaxTests/functionTypes/comparison_of_function_types_gt_2.sol index 961ca732d..000aea879 100644 --- a/test/libsolidity/syntaxTests/functionTypes/comparison_of_function_types_gt_2.sol +++ b/test/libsolidity/syntaxTests/functionTypes/comparison_of_function_types_gt_2.sol @@ -4,4 +4,4 @@ contract C { } } // ---- -// TypeError 2271: (73-78): Binary operator > not compatible with types function () returns (bool) and function () returns (bool). +// TypeError 2271: (73-78): Built-in binary operator > cannot be applied to types function () returns (bool) and function () returns (bool). diff --git a/test/libsolidity/syntaxTests/functionTypes/comparison_of_function_types_lt_1.sol b/test/libsolidity/syntaxTests/functionTypes/comparison_of_function_types_lt_1.sol index 23fc671f0..ea1c55d3e 100644 --- a/test/libsolidity/syntaxTests/functionTypes/comparison_of_function_types_lt_1.sol +++ b/test/libsolidity/syntaxTests/functionTypes/comparison_of_function_types_lt_1.sol @@ -4,4 +4,4 @@ contract C { } } // ---- -// TypeError 2271: (73-88): Binary operator < not compatible with types function () external returns (bool) and function () external returns (bool). +// TypeError 2271: (73-88): Built-in binary operator < cannot be applied to types function () external returns (bool) and function () external returns (bool). diff --git a/test/libsolidity/syntaxTests/functionTypes/comparison_of_function_types_lt_2.sol b/test/libsolidity/syntaxTests/functionTypes/comparison_of_function_types_lt_2.sol index a55b0fb60..dc973ff60 100644 --- a/test/libsolidity/syntaxTests/functionTypes/comparison_of_function_types_lt_2.sol +++ b/test/libsolidity/syntaxTests/functionTypes/comparison_of_function_types_lt_2.sol @@ -4,4 +4,4 @@ contract C { } } // ---- -// TypeError 2271: (73-78): Binary operator < not compatible with types function () returns (bool) and function () returns (bool). +// TypeError 2271: (73-78): Built-in binary operator < cannot be applied to types function () returns (bool) and function () returns (bool). diff --git a/test/libsolidity/syntaxTests/functionTypes/comparison_operator_for_external_functions_with_extra_gas_slots.sol b/test/libsolidity/syntaxTests/functionTypes/comparison_operator_for_external_functions_with_extra_gas_slots.sol index 370d4d2c3..12cbe2939 100644 --- a/test/libsolidity/syntaxTests/functionTypes/comparison_operator_for_external_functions_with_extra_gas_slots.sol +++ b/test/libsolidity/syntaxTests/functionTypes/comparison_operator_for_external_functions_with_extra_gas_slots.sol @@ -8,5 +8,5 @@ contract C { } } // ---- -// TypeError 2271: (193-259): Binary operator == not compatible with types function () external and function () external. -// TypeError 2271: (277-351): Binary operator == not compatible with types function () external and function () external. +// TypeError 2271: (193-259): Built-in binary operator == cannot be applied to types function () external and function () external. +// TypeError 2271: (277-351): Built-in binary operator == cannot be applied to types function () external and function () external. diff --git a/test/libsolidity/syntaxTests/functionTypes/comparison_operators_between_internal_and_external_function_pointers.sol b/test/libsolidity/syntaxTests/functionTypes/comparison_operators_between_internal_and_external_function_pointers.sol index d0dfd2ea0..7c0bf0960 100644 --- a/test/libsolidity/syntaxTests/functionTypes/comparison_operators_between_internal_and_external_function_pointers.sol +++ b/test/libsolidity/syntaxTests/functionTypes/comparison_operators_between_internal_and_external_function_pointers.sol @@ -19,5 +19,5 @@ contract C { } } // ---- -// TypeError 2271: (606-672): Binary operator != not compatible with types function () and function () external. -// TypeError 2271: (688-741): Binary operator != not compatible with types function () and function () external. +// TypeError 2271: (606-672): Built-in binary operator != cannot be applied to types function () and function () external. +// TypeError 2271: (688-741): Built-in binary operator != cannot be applied to types function () and function () external. diff --git a/test/libsolidity/syntaxTests/functionTypes/comparison_operators_external_functions_with_different_parameters.sol b/test/libsolidity/syntaxTests/functionTypes/comparison_operators_external_functions_with_different_parameters.sol index 8ea5984de..599e9286e 100644 --- a/test/libsolidity/syntaxTests/functionTypes/comparison_operators_external_functions_with_different_parameters.sol +++ b/test/libsolidity/syntaxTests/functionTypes/comparison_operators_external_functions_with_different_parameters.sol @@ -21,6 +21,6 @@ contract C { // ---- // TypeError 9574: (249-333): Type function (uint256) external is not implicitly convertible to expected type function () external. // TypeError 9574: (343-427): Type function (bool) external is not implicitly convertible to expected type function () external. -// TypeError 2271: (458-522): Binary operator == not compatible with types function (uint256) external and function () external. -// TypeError 2271: (538-602): Binary operator == not compatible with types function (bool) external and function () external. -// TypeError 2271: (726-786): Binary operator != not compatible with types function (bool) external and function (uint256) external. +// TypeError 2271: (458-522): Built-in binary operator == cannot be applied to types function (uint256) external and function () external. +// TypeError 2271: (538-602): Built-in binary operator == cannot be applied to types function (bool) external and function () external. +// TypeError 2271: (726-786): Built-in binary operator != cannot be applied to types function (bool) external and function (uint256) external. diff --git a/test/libsolidity/syntaxTests/literalOperations/division_by_zero.sol b/test/libsolidity/syntaxTests/literalOperations/division_by_zero.sol index a8fffedfc..5685084d5 100644 --- a/test/libsolidity/syntaxTests/literalOperations/division_by_zero.sol +++ b/test/libsolidity/syntaxTests/literalOperations/division_by_zero.sol @@ -2,4 +2,4 @@ contract C { uint constant a = 1 / 0; } // ---- -// TypeError 2271: (35-40): Binary operator / not compatible with types int_const 1 and int_const 0. +// TypeError 2271: (35-40): Built-in binary operator / cannot be applied to types int_const 1 and int_const 0. diff --git a/test/libsolidity/syntaxTests/literalOperations/division_by_zero_complex.sol b/test/libsolidity/syntaxTests/literalOperations/division_by_zero_complex.sol index d6e830275..195336e27 100644 --- a/test/libsolidity/syntaxTests/literalOperations/division_by_zero_complex.sol +++ b/test/libsolidity/syntaxTests/literalOperations/division_by_zero_complex.sol @@ -2,4 +2,4 @@ contract C { uint constant a = 1 / ((1+3)-4); } // ---- -// TypeError 2271: (35-48): Binary operator / not compatible with types int_const 1 and int_const 0. +// TypeError 2271: (35-48): Built-in binary operator / cannot be applied to types int_const 1 and int_const 0. diff --git a/test/libsolidity/syntaxTests/literalOperations/exponent.sol b/test/libsolidity/syntaxTests/literalOperations/exponent.sol index 53cd130ff..72dc5ecd4 100644 --- a/test/libsolidity/syntaxTests/literalOperations/exponent.sol +++ b/test/libsolidity/syntaxTests/literalOperations/exponent.sol @@ -6,5 +6,5 @@ contract C { } } // ---- -// TypeError 2271: (67-78): Binary operator ** not compatible with types int256 and int_const 1000...(1226 digits omitted)...0000. Exponent too large. -// TypeError 2271: (88-98): Binary operator ** not compatible with types int256 and rational_const 1 / 2. Exponent is fractional. +// TypeError 2271: (67-78): Built-in binary operator ** cannot be applied to types int256 and int_const 1000...(1226 digits omitted)...0000. Exponent too large. +// TypeError 2271: (88-98): Built-in binary operator ** cannot be applied to types int256 and rational_const 1 / 2. Exponent is fractional. diff --git a/test/libsolidity/syntaxTests/literalOperations/mod_zero.sol b/test/libsolidity/syntaxTests/literalOperations/mod_zero.sol index 17c58c662..b4ca4d27b 100644 --- a/test/libsolidity/syntaxTests/literalOperations/mod_zero.sol +++ b/test/libsolidity/syntaxTests/literalOperations/mod_zero.sol @@ -2,4 +2,4 @@ contract C { uint constant b3 = 1 % 0; } // ---- -// TypeError 2271: (36-41): Binary operator % not compatible with types int_const 1 and int_const 0. +// TypeError 2271: (36-41): Built-in binary operator % cannot be applied to types int_const 1 and int_const 0. diff --git a/test/libsolidity/syntaxTests/literalOperations/mod_zero_complex.sol b/test/libsolidity/syntaxTests/literalOperations/mod_zero_complex.sol index bdb783d6a..73cbd71fe 100644 --- a/test/libsolidity/syntaxTests/literalOperations/mod_zero_complex.sol +++ b/test/libsolidity/syntaxTests/literalOperations/mod_zero_complex.sol @@ -2,4 +2,4 @@ contract C { uint constant b3 = 1 % (-4+((2)*2)); } // ---- -// TypeError 2271: (36-52): Binary operator % not compatible with types int_const 1 and int_const 0. +// TypeError 2271: (36-52): Built-in binary operator % cannot be applied to types int_const 1 and int_const 0. diff --git a/test/libsolidity/syntaxTests/metaTypes/integer_err.sol b/test/libsolidity/syntaxTests/metaTypes/integer_err.sol index f8f416898..7e703b72e 100644 --- a/test/libsolidity/syntaxTests/metaTypes/integer_err.sol +++ b/test/libsolidity/syntaxTests/metaTypes/integer_err.sol @@ -12,4 +12,4 @@ contract Test { // ---- // TypeError 9574: (59-89): Type int256 is not implicitly convertible to expected type uint8. // TypeError 9574: (99-127): Type int256 is not implicitly convertible to expected type uint256. -// TypeError 2271: (142-169): Binary operator == not compatible with types int256 and int_const 1157...(70 digits omitted)...9935. +// TypeError 2271: (142-169): Built-in binary operator == cannot be applied to types int256 and int_const 1157...(70 digits omitted)...9935. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/011_type_conversion_for_comparison_invalid.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/011_type_conversion_for_comparison_invalid.sol index b2e19102d..f191d4478 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/011_type_conversion_for_comparison_invalid.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/011_type_conversion_for_comparison_invalid.sol @@ -2,4 +2,4 @@ contract test { function f() public { int32(2) == uint64(2); } } // ---- -// TypeError 2271: (42-63): Binary operator == not compatible with types int32 and uint64. +// TypeError 2271: (42-63): Built-in binary operator == cannot be applied to types int32 and uint64. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/025_comparison_of_mapping_types.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/025_comparison_of_mapping_types.sol index 854f4cce4..d31f5fa3b 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/025_comparison_of_mapping_types.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/025_comparison_of_mapping_types.sol @@ -6,4 +6,4 @@ contract C { } } // ---- -// TypeError 2271: (147-153): Binary operator == not compatible with types mapping(uint256 => uint256) and mapping(uint256 => uint256). +// TypeError 2271: (147-153): Built-in binary operator == cannot be applied to types mapping(uint256 => uint256) and mapping(uint256 => uint256). diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/112_exp_operator_exponent_too_big.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/112_exp_operator_exponent_too_big.sol index c28711989..ea571b72a 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/112_exp_operator_exponent_too_big.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/112_exp_operator_exponent_too_big.sol @@ -2,4 +2,4 @@ contract test { function f() public returns (uint d) { return 2 ** 10000000000; } } // ---- -// TypeError 2271: (66-82): Binary operator ** not compatible with types int_const 2 and int_const 10000000000. +// TypeError 2271: (66-82): Built-in binary operator ** cannot be applied to types int_const 2 and int_const 10000000000. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/196_integer_boolean_or.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/196_integer_boolean_or.sol index f53cd2d80..e3e0dd2a3 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/196_integer_boolean_or.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/196_integer_boolean_or.sol @@ -1,3 +1,3 @@ contract test { fallback() external { uint x = 1; uint y = 2; x || y; } } // ---- -// TypeError 2271: (62-68): Binary operator || not compatible with types uint256 and uint256. +// TypeError 2271: (62-68): Built-in binary operator || cannot be applied to types uint256 and uint256. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/197_integer_boolean_and.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/197_integer_boolean_and.sol index 13ab8f66b..d8141a2aa 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/197_integer_boolean_and.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/197_integer_boolean_and.sol @@ -1,3 +1,3 @@ contract test { fallback() external { uint x = 1; uint y = 2; x && y; } } // ---- -// TypeError 2271: (62-68): Binary operator && not compatible with types uint256 and uint256. +// TypeError 2271: (62-68): Built-in binary operator && cannot be applied to types uint256 and uint256. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/199_integer_unsigned_exp_signed.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/199_integer_unsigned_exp_signed.sol index ef3735756..5f5e82090 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/199_integer_unsigned_exp_signed.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/199_integer_unsigned_exp_signed.sol @@ -1,3 +1,3 @@ contract test { fallback() external { uint x = 3; int y = -4; x ** y; } } // ---- -// TypeError 2271: (62-68): Binary operator ** not compatible with types uint256 and int256. Exponentiation power is not allowed to be a signed integer type. +// TypeError 2271: (62-68): Built-in binary operator ** cannot be applied to types uint256 and int256. Exponentiation power is not allowed to be a signed integer type. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/201_integer_signed_exp_signed.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/201_integer_signed_exp_signed.sol index 58f990c1f..f7f3df910 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/201_integer_signed_exp_signed.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/201_integer_signed_exp_signed.sol @@ -4,7 +4,7 @@ contract test { function i() public { int16 x = 4; x ** -3; } } // ---- -// TypeError 2271: (64-70): Binary operator ** not compatible with types int256 and int256. Exponentiation power is not allowed to be a signed integer type. -// TypeError 2271: (126-132): Binary operator ** not compatible with types uint8 and int16. Exponentiation power is not allowed to be a signed integer type. +// TypeError 2271: (64-70): Built-in binary operator ** cannot be applied to types int256 and int256. Exponentiation power is not allowed to be a signed integer type. +// TypeError 2271: (126-132): Built-in binary operator ** cannot be applied to types uint8 and int16. Exponentiation power is not allowed to be a signed integer type. // Warning 3149: (126-132): The result type of the exponentiation operation is equal to the type of the first operand (uint8) ignoring the (larger) type of the second operand (int16) which might be unexpected. Silence this warning by either converting the first or the second operand to the type of the other. -// TypeError 2271: (175-182): Binary operator ** not compatible with types int16 and int_const -3. Exponentiation power is not allowed to be a negative integer literal. +// TypeError 2271: (175-182): Built-in binary operator ** cannot be applied to types int16 and int_const -3. Exponentiation power is not allowed to be a negative integer literal. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/202_bytes_reference_compare_operators.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/202_bytes_reference_compare_operators.sol index 72a4ef1c2..064afd46b 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/202_bytes_reference_compare_operators.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/202_bytes_reference_compare_operators.sol @@ -1,3 +1,3 @@ contract test { bytes a; bytes b; fallback() external { a == b; } } // ---- -// TypeError 2271: (56-62): Binary operator == not compatible with types bytes storage ref and bytes storage ref. +// TypeError 2271: (56-62): Built-in binary operator == cannot be applied to types bytes storage ref and bytes storage ref. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/203_struct_reference_compare_operators.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/203_struct_reference_compare_operators.sol index 26c9068d5..1cf46ac83 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/203_struct_reference_compare_operators.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/203_struct_reference_compare_operators.sol @@ -7,4 +7,4 @@ contract test { } } // ---- -// TypeError 2271: (79-85): Binary operator == not compatible with types struct test.s storage ref and struct test.s storage ref. No matching user-defined operator found. +// TypeError 2271: (79-85): Built-in binary operator == cannot be applied to types struct test.s storage ref and struct test.s storage ref. No matching user-defined operator found. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/329_rational_as_exponent_value_signed.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/329_rational_as_exponent_value_signed.sol index d0679229c..d604ac7b4 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/329_rational_as_exponent_value_signed.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/329_rational_as_exponent_value_signed.sol @@ -4,4 +4,4 @@ contract test { } } // ---- -// TypeError 2271: (60-69): Binary operator ** not compatible with types int_const 2 and rational_const -11 / 5. +// TypeError 2271: (60-69): Built-in binary operator ** cannot be applied to types int_const 2 and rational_const -11 / 5. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/330_rational_as_exponent_value_unsigned.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/330_rational_as_exponent_value_unsigned.sol index b600cd767..800397524 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/330_rational_as_exponent_value_unsigned.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/330_rational_as_exponent_value_unsigned.sol @@ -4,4 +4,4 @@ contract test { } } // ---- -// TypeError 2271: (61-69): Binary operator ** not compatible with types int_const 3 and rational_const 5 / 2. +// TypeError 2271: (61-69): Built-in binary operator ** cannot be applied to types int_const 3 and rational_const 5 / 2. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/331_rational_as_exponent_half.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/331_rational_as_exponent_half.sol index cf7b82b98..e2843d34f 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/331_rational_as_exponent_half.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/331_rational_as_exponent_half.sol @@ -4,4 +4,4 @@ contract test { } } // ---- -// TypeError 2271: (50-60): Binary operator ** not compatible with types int_const 2 and rational_const 1 / 2. +// TypeError 2271: (50-60): Built-in binary operator ** cannot be applied to types int_const 2 and rational_const 1 / 2. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/332_rational_as_exponent_value_neg_quarter.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/332_rational_as_exponent_value_neg_quarter.sol index 1e42213b9..5b84f1a50 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/332_rational_as_exponent_value_neg_quarter.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/332_rational_as_exponent_value_neg_quarter.sol @@ -4,4 +4,4 @@ contract test { } } // ---- -// TypeError 2271: (50-62): Binary operator ** not compatible with types int_const 42 and rational_const -1 / 4. +// TypeError 2271: (50-62): Built-in binary operator ** cannot be applied to types int_const 42 and rational_const -1 / 4. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/333_fixed_point_casting_exponents_15.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/333_fixed_point_casting_exponents_15.sol index 380bb8b4c..3c7082f17 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/333_fixed_point_casting_exponents_15.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/333_fixed_point_casting_exponents_15.sol @@ -4,4 +4,4 @@ contract test { } } // ---- -// TypeError 2271: (61-77): Binary operator ** not compatible with types int_const 3 and ufixed128x18. Exponent is fractional. +// TypeError 2271: (61-77): Built-in binary operator ** cannot be applied to types int_const 3 and ufixed128x18. Exponent is fractional. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/334_fixed_point_casting_exponents_neg.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/334_fixed_point_casting_exponents_neg.sol index 2089d9708..c462d5015 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/334_fixed_point_casting_exponents_neg.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/334_fixed_point_casting_exponents_neg.sol @@ -4,4 +4,4 @@ contract test { } } // ---- -// TypeError 2271: (61-78): Binary operator ** not compatible with types int_const 42 and fixed128x18. Exponent is fractional. +// TypeError 2271: (61-78): Built-in binary operator ** cannot be applied to types int_const 42 and fixed128x18. Exponent is fractional. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/339_rational_bitor_binary_operation.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/339_rational_bitor_binary_operation.sol index 6ea94382b..93cbd9ce6 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/339_rational_bitor_binary_operation.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/339_rational_bitor_binary_operation.sol @@ -4,4 +4,4 @@ contract test { } } // ---- -// TypeError 2271: (50-64): Binary operator | not compatible with types fixed128x18 and int_const 3. +// TypeError 2271: (50-64): Built-in binary operator | cannot be applied to types fixed128x18 and int_const 3. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/340_rational_bitxor_binary_operation.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/340_rational_bitxor_binary_operation.sol index 01da3c3f9..d8792c6bc 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/340_rational_bitxor_binary_operation.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/340_rational_bitxor_binary_operation.sol @@ -4,4 +4,4 @@ contract test { } } // ---- -// TypeError 2271: (50-65): Binary operator ^ not compatible with types fixed128x18 and int_const 3. +// TypeError 2271: (50-65): Built-in binary operator ^ cannot be applied to types fixed128x18 and int_const 3. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/341_rational_bitand_binary_operation.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/341_rational_bitand_binary_operation.sol index 6c8f57d69..0cd2d7f23 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/341_rational_bitand_binary_operation.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/341_rational_bitand_binary_operation.sol @@ -4,4 +4,4 @@ contract test { } } // ---- -// TypeError 2271: (50-65): Binary operator & not compatible with types fixed128x18 and int_const 3. +// TypeError 2271: (50-65): Built-in binary operator & cannot be applied to types fixed128x18 and int_const 3. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/368_shift_constant_left_negative_rvalue.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/368_shift_constant_left_negative_rvalue.sol index 5831d10e1..6cbf05825 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/368_shift_constant_left_negative_rvalue.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/368_shift_constant_left_negative_rvalue.sol @@ -2,4 +2,4 @@ contract C { uint public a = 0x42 << -8; } // ---- -// TypeError 2271: (33-43): Binary operator << not compatible with types int_const 66 and int_const -8. +// TypeError 2271: (33-43): Built-in binary operator << cannot be applied to types int_const 66 and int_const -8. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/369_shift_constant_right_negative_rvalue.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/369_shift_constant_right_negative_rvalue.sol index 4582a2abd..b7eca3d2f 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/369_shift_constant_right_negative_rvalue.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/369_shift_constant_right_negative_rvalue.sol @@ -2,4 +2,4 @@ contract C { uint public a = 0x42 >> -8; } // ---- -// TypeError 2271: (33-43): Binary operator >> not compatible with types int_const 66 and int_const -8. +// TypeError 2271: (33-43): Built-in binary operator >> cannot be applied to types int_const 66 and int_const -8. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/370_shift_constant_left_excessive_rvalue.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/370_shift_constant_left_excessive_rvalue.sol index 7234c189b..4272c357b 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/370_shift_constant_left_excessive_rvalue.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/370_shift_constant_left_excessive_rvalue.sol @@ -2,4 +2,4 @@ contract C { uint public a = 0x42 << 0x100000000; } // ---- -// TypeError 2271: (33-52): Binary operator << not compatible with types int_const 66 and int_const 4294967296. +// TypeError 2271: (33-52): Built-in binary operator << cannot be applied to types int_const 66 and int_const 4294967296. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/371_shift_constant_right_excessive_rvalue.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/371_shift_constant_right_excessive_rvalue.sol index af1631203..2c3cec95e 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/371_shift_constant_right_excessive_rvalue.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/371_shift_constant_right_excessive_rvalue.sol @@ -2,4 +2,4 @@ contract C { uint public a = 0x42 >> 0x100000000; } // ---- -// TypeError 2271: (33-52): Binary operator >> not compatible with types int_const 66 and int_const 4294967296. +// TypeError 2271: (33-52): Built-in binary operator >> cannot be applied to types int_const 66 and int_const 4294967296. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/372_shift_constant_right_fractional.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/372_shift_constant_right_fractional.sol index 81e084a29..913572d45 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/372_shift_constant_right_fractional.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/372_shift_constant_right_fractional.sol @@ -2,4 +2,4 @@ contract C { uint public a = 0x42 >> (1 / 2); } // ---- -// TypeError 2271: (33-48): Binary operator >> not compatible with types int_const 66 and rational_const 1 / 2. +// TypeError 2271: (33-48): Built-in binary operator >> cannot be applied to types int_const 66 and rational_const 1 / 2. diff --git a/test/libsolidity/syntaxTests/operators/binary_operator_cannot_be_applied.sol b/test/libsolidity/syntaxTests/operators/binary_operator_cannot_be_applied.sol index 76258a1a4..ea0c8f9d8 100644 --- a/test/libsolidity/syntaxTests/operators/binary_operator_cannot_be_applied.sol +++ b/test/libsolidity/syntaxTests/operators/binary_operator_cannot_be_applied.sol @@ -7,5 +7,5 @@ function f() pure { } // ---- -// TypeError 2271: (70-75): Binary operator + not compatible with types Int and Int. No matching user-defined operator found. -// TypeError 2271: (81-88): Binary operator >>> not compatible with types Int and Int. +// TypeError 2271: (70-75): Built-in binary operator + cannot be applied to types Int and Int. No matching user-defined operator found. +// TypeError 2271: (81-88): Built-in binary operator >>> cannot be applied to types Int and Int. diff --git a/test/libsolidity/syntaxTests/operators/custom/bind_function_to_operator_that_already_has_function_bound_as_global.sol b/test/libsolidity/syntaxTests/operators/custom/bind_function_to_operator_that_already_has_function_bound_as_global.sol index 68ab09637..66fe24910 100644 --- a/test/libsolidity/syntaxTests/operators/custom/bind_function_to_operator_that_already_has_function_bound_as_global.sol +++ b/test/libsolidity/syntaxTests/operators/custom/bind_function_to_operator_that_already_has_function_bound_as_global.sol @@ -21,4 +21,4 @@ function test() pure returns (Int) { } // ---- -// TypeError 2271: (test.sol:181-206): Binary operator + not compatible with types Int and Int. Multiple user-defined functions provided for this operator. +// TypeError 2271: (test.sol:181-206): Built-in binary operator + cannot be applied to types Int and Int. Multiple user-defined functions provided for this operator. diff --git a/test/libsolidity/syntaxTests/operators/custom/conversion_between_data_locations_is_blocked.sol b/test/libsolidity/syntaxTests/operators/custom/conversion_between_data_locations_is_blocked.sol index 3c766a616..7244b206d 100644 --- a/test/libsolidity/syntaxTests/operators/custom/conversion_between_data_locations_is_blocked.sol +++ b/test/libsolidity/syntaxTests/operators/custom/conversion_between_data_locations_is_blocked.sol @@ -34,9 +34,9 @@ contract C { } } // ---- -// TypeError 2271: (421-426): Binary operator + not compatible with types struct S calldata and struct S calldata. No matching user-defined operator found. -// TypeError 2271: (458-463): Binary operator + not compatible with types struct S storage ref and struct S storage ref. No matching user-defined operator found. -// TypeError 2271: (495-500): Binary operator - not compatible with types struct S memory and struct S memory. No matching user-defined operator found. -// TypeError 2271: (532-537): Binary operator - not compatible with types struct S storage ref and struct S storage ref. No matching user-defined operator found. -// TypeError 2271: (571-576): Binary operator * not compatible with types struct S calldata and struct S calldata. No matching user-defined operator found. -// TypeError 2271: (609-614): Binary operator * not compatible with types struct S memory and struct S memory. No matching user-defined operator found. +// TypeError 2271: (421-426): Built-in binary operator + cannot be applied to types struct S calldata and struct S calldata. No matching user-defined operator found. +// TypeError 2271: (458-463): Built-in binary operator + cannot be applied to types struct S storage ref and struct S storage ref. No matching user-defined operator found. +// TypeError 2271: (495-500): Built-in binary operator - cannot be applied to types struct S memory and struct S memory. No matching user-defined operator found. +// TypeError 2271: (532-537): Built-in binary operator - cannot be applied to types struct S storage ref and struct S storage ref. No matching user-defined operator found. +// TypeError 2271: (571-576): Built-in binary operator * cannot be applied to types struct S calldata and struct S calldata. No matching user-defined operator found. +// TypeError 2271: (609-614): Built-in binary operator * cannot be applied to types struct S memory and struct S memory. No matching user-defined operator found. diff --git a/test/libsolidity/syntaxTests/operators/custom/implicit_conversion_is_blocked.sol b/test/libsolidity/syntaxTests/operators/custom/implicit_conversion_is_blocked.sol index e91fee25d..64e01361b 100644 --- a/test/libsolidity/syntaxTests/operators/custom/implicit_conversion_is_blocked.sol +++ b/test/libsolidity/syntaxTests/operators/custom/implicit_conversion_is_blocked.sol @@ -28,9 +28,9 @@ contract C { } // ---- -// TypeError 2271: (311-316): Binary operator + not compatible with types struct S storage ref and struct S storage ref. No matching user-defined operator found. +// TypeError 2271: (311-316): Built-in binary operator + cannot be applied to types struct S storage ref and struct S storage ref. No matching user-defined operator found. // TypeError 5653: (326-336): User defined binary operator + not compatible with types struct S memory and bool. -// TypeError 2271: (346-354): Binary operator + not compatible with types bool and struct S storage ref. +// TypeError 2271: (346-354): Built-in binary operator + cannot be applied to types bool and struct S storage ref. // TypeError 4907: (364-369): Built-in unary operator - cannot be applied to type struct S storage pointer. No matching user-defined operator found. // TypeError 4907: (379-381): Built-in unary operator - cannot be applied to type struct S storage ref. No matching user-defined operator found. // TypeError 4907: (391-396): Built-in unary operator - cannot be applied to type bool. diff --git a/test/libsolidity/syntaxTests/operators/custom/operator_bind_is_not_inherited.sol b/test/libsolidity/syntaxTests/operators/custom/operator_bind_is_not_inherited.sol index 37314b45a..4329092c0 100644 --- a/test/libsolidity/syntaxTests/operators/custom/operator_bind_is_not_inherited.sol +++ b/test/libsolidity/syntaxTests/operators/custom/operator_bind_is_not_inherited.sol @@ -31,4 +31,4 @@ contract D is B { } // ---- -// TypeError 2271: (542-567): Binary operator + not compatible with types Int and Int. No matching user-defined operator found. +// TypeError 2271: (542-567): Built-in binary operator + cannot be applied to types Int and Int. No matching user-defined operator found. diff --git a/test/libsolidity/syntaxTests/operators/custom/operator_bind_on_file_and_contract_level.sol b/test/libsolidity/syntaxTests/operators/custom/operator_bind_on_file_and_contract_level.sol index 234122cde..4eab37294 100644 --- a/test/libsolidity/syntaxTests/operators/custom/operator_bind_on_file_and_contract_level.sol +++ b/test/libsolidity/syntaxTests/operators/custom/operator_bind_on_file_and_contract_level.sol @@ -25,4 +25,4 @@ contract C is B { } // ---- -// TypeError 2271: (281-306): Binary operator + not compatible with types Int and Int. Multiple user-defined functions provided for this operator. +// TypeError 2271: (281-306): Built-in binary operator + cannot be applied to types Int and Int. Multiple user-defined functions provided for this operator. diff --git a/test/libsolidity/syntaxTests/operators/custom/operator_binding_is_not_transitive_through_imports.sol b/test/libsolidity/syntaxTests/operators/custom/operator_binding_is_not_transitive_through_imports.sol index b9249db5f..42f1a5f9d 100644 --- a/test/libsolidity/syntaxTests/operators/custom/operator_binding_is_not_transitive_through_imports.sol +++ b/test/libsolidity/syntaxTests/operators/custom/operator_binding_is_not_transitive_through_imports.sol @@ -27,4 +27,4 @@ contract C { } // ---- -// TypeError 2271: (s3.sol:81-106): Binary operator + not compatible with types Int and Int. No matching user-defined operator found. +// TypeError 2271: (s3.sol:81-106): Built-in binary operator + cannot be applied to types Int and Int. No matching user-defined operator found. diff --git a/test/libsolidity/syntaxTests/operators/custom/operator_invalid_parameters.sol b/test/libsolidity/syntaxTests/operators/custom/operator_invalid_parameters.sol index 8af04692e..96266730b 100644 --- a/test/libsolidity/syntaxTests/operators/custom/operator_invalid_parameters.sol +++ b/test/libsolidity/syntaxTests/operators/custom/operator_invalid_parameters.sol @@ -29,6 +29,6 @@ function f() pure { // TypeError 8112: (47-50): The function "sub" needs to have one or two parameters of type Int and the same data location to be used for the operator -. // TypeError 7617: (61-64): The function "div" needs to have one or two parameters of type Int and the same data location to be used for the operator /. // TypeError 3605: (61-64): The function "div" needs to have parameters and return value of the same type to be used for the operator /. -// TypeError 2271: (325-350): Binary operator + not compatible with types Int and Int. No matching user-defined operator found. -// TypeError 2271: (356-381): Binary operator - not compatible with types Int and Int. No matching user-defined operator found. -// TypeError 2271: (387-412): Binary operator / not compatible with types Int and Int. No matching user-defined operator found. +// TypeError 2271: (325-350): Built-in binary operator + cannot be applied to types Int and Int. No matching user-defined operator found. +// TypeError 2271: (356-381): Built-in binary operator - cannot be applied to types Int and Int. No matching user-defined operator found. +// TypeError 2271: (387-412): Built-in binary operator / cannot be applied to types Int and Int. No matching user-defined operator found. diff --git a/test/libsolidity/syntaxTests/operators/custom/operator_with_calldata_parameters.sol b/test/libsolidity/syntaxTests/operators/custom/operator_with_calldata_parameters.sol index d64f72a72..061178769 100644 --- a/test/libsolidity/syntaxTests/operators/custom/operator_with_calldata_parameters.sol +++ b/test/libsolidity/syntaxTests/operators/custom/operator_with_calldata_parameters.sol @@ -64,5 +64,5 @@ function test(S calldata s) pure { // TypeError 7617: (82-87): The function "unsub" needs to have one or two parameters of type S and the same data location to be used for the operator -. // TypeError 3605: (82-87): The function "unsub" needs to have parameters and return value of the same type to be used for the operator -. // TypeError 7743: (98-104): The function "bitnot" needs to return exactly one value of type S to be used for the operator ~. -// TypeError 2271: (764-769): Binary operator * not compatible with types struct S calldata and struct S calldata. No matching user-defined operator found. +// TypeError 2271: (764-769): Built-in binary operator * cannot be applied to types struct S calldata and struct S calldata. No matching user-defined operator found. // TypeError 4907: (797-799): Built-in unary operator - cannot be applied to type struct S calldata. No matching user-defined operator found. diff --git a/test/libsolidity/syntaxTests/operators/custom/operator_with_storage_parameters.sol b/test/libsolidity/syntaxTests/operators/custom/operator_with_storage_parameters.sol index b3cd23576..596d4b8d4 100644 --- a/test/libsolidity/syntaxTests/operators/custom/operator_with_storage_parameters.sol +++ b/test/libsolidity/syntaxTests/operators/custom/operator_with_storage_parameters.sol @@ -59,5 +59,5 @@ contract C { // TypeError 7743: (68-71): The function "mod" needs to return exactly one value of type S to be used for the operator %. // TypeError 7743: (82-87): The function "unsub" needs to return exactly one value of type S to be used for the operator -. // TypeError 1147: (98-104): The function "bitnot" needs to have exactly one parameter of type S to be used for the operator ~. -// TypeError 2271: (728-733): Binary operator * not compatible with types struct S storage ref and struct S storage ref. No matching user-defined operator found. +// TypeError 2271: (728-733): Built-in binary operator * cannot be applied to types struct S storage ref and struct S storage ref. No matching user-defined operator found. // TypeError 4907: (785-787): Built-in unary operator ~ cannot be applied to type struct S storage ref. No matching user-defined operator found. diff --git a/test/libsolidity/syntaxTests/operators/custom/two_functions_bound_to_operator.sol b/test/libsolidity/syntaxTests/operators/custom/two_functions_bound_to_operator.sol index 0ea48d80f..b7f117e3a 100644 --- a/test/libsolidity/syntaxTests/operators/custom/two_functions_bound_to_operator.sol +++ b/test/libsolidity/syntaxTests/operators/custom/two_functions_bound_to_operator.sol @@ -14,4 +14,4 @@ function test() { Int.wrap(0) + Int.wrap(1); } // ---- -// TypeError 2271: (213-238): Binary operator + not compatible with types Int and Int. Multiple user-defined functions provided for this operator. +// TypeError 2271: (213-238): Built-in binary operator + cannot be applied to types Int and Int. Multiple user-defined functions provided for this operator. diff --git a/test/libsolidity/syntaxTests/shifts/shift_singed_rvalue.sol b/test/libsolidity/syntaxTests/shifts/shift_singed_rvalue.sol index 8dd9a7e8c..1ca57bdcc 100644 --- a/test/libsolidity/syntaxTests/shifts/shift_singed_rvalue.sol +++ b/test/libsolidity/syntaxTests/shifts/shift_singed_rvalue.sol @@ -7,5 +7,5 @@ contract C { } } // ---- -// TypeError 2271: (89-95): Binary operator >> not compatible with types int256 and int256. -// TypeError 2271: (179-193): Binary operator >> not compatible with types int256 and int256. +// TypeError 2271: (89-95): Built-in binary operator >> cannot be applied to types int256 and int256. +// TypeError 2271: (179-193): Built-in binary operator >> cannot be applied to types int256 and int256. diff --git a/test/libsolidity/syntaxTests/signed_rational_modulus.sol b/test/libsolidity/syntaxTests/signed_rational_modulus.sol index de1060794..a3acf182f 100644 --- a/test/libsolidity/syntaxTests/signed_rational_modulus.sol +++ b/test/libsolidity/syntaxTests/signed_rational_modulus.sol @@ -7,4 +7,4 @@ contract test { } } // ---- -// TypeError 2271: (117-123): Binary operator % not compatible with types rational_const 1 / 2 and fixed128x18. Fractional literals not supported. +// TypeError 2271: (117-123): Built-in binary operator % cannot be applied to types rational_const 1 / 2 and fixed128x18. Fractional literals not supported. diff --git a/test/libsolidity/syntaxTests/types/address/address_binary_operators.sol b/test/libsolidity/syntaxTests/types/address/address_binary_operators.sol index e3fdbaa0a..7535e6da5 100644 --- a/test/libsolidity/syntaxTests/types/address/address_binary_operators.sol +++ b/test/libsolidity/syntaxTests/types/address/address_binary_operators.sol @@ -9,7 +9,7 @@ contract C { } } // ---- -// TypeError 2271: (85-108): Binary operator + not compatible with types address and address. Arithmetic operations on addresses are not supported. Convert to integer first before using them. -// TypeError 2271: (122-145): Binary operator - not compatible with types address and address. Arithmetic operations on addresses are not supported. Convert to integer first before using them. -// TypeError 2271: (159-182): Binary operator * not compatible with types address and address. Arithmetic operations on addresses are not supported. Convert to integer first before using them. -// TypeError 2271: (196-219): Binary operator / not compatible with types address and address. Arithmetic operations on addresses are not supported. Convert to integer first before using them. +// TypeError 2271: (85-108): Built-in binary operator + cannot be applied to types address and address. Arithmetic operations on addresses are not supported. Convert to integer first before using them. +// TypeError 2271: (122-145): Built-in binary operator - cannot be applied to types address and address. Arithmetic operations on addresses are not supported. Convert to integer first before using them. +// TypeError 2271: (159-182): Built-in binary operator * cannot be applied to types address and address. Arithmetic operations on addresses are not supported. Convert to integer first before using them. +// TypeError 2271: (196-219): Built-in binary operator / cannot be applied to types address and address. Arithmetic operations on addresses are not supported. Convert to integer first before using them. diff --git a/test/libsolidity/syntaxTests/types/bool_ops.sol b/test/libsolidity/syntaxTests/types/bool_ops.sol index ef6a28f4f..08501ff5b 100644 --- a/test/libsolidity/syntaxTests/types/bool_ops.sol +++ b/test/libsolidity/syntaxTests/types/bool_ops.sol @@ -32,22 +32,22 @@ contract C { } } // ---- -// TypeError 2271: (231-236): Binary operator > not compatible with types bool and bool. -// TypeError 2271: (250-255): Binary operator < not compatible with types bool and bool. -// TypeError 2271: (269-275): Binary operator >= not compatible with types bool and bool. -// TypeError 2271: (289-295): Binary operator <= not compatible with types bool and bool. -// TypeError 2271: (309-314): Binary operator & not compatible with types bool and bool. -// TypeError 2271: (328-333): Binary operator | not compatible with types bool and bool. -// TypeError 2271: (347-352): Binary operator ^ not compatible with types bool and bool. +// TypeError 2271: (231-236): Built-in binary operator > cannot be applied to types bool and bool. +// TypeError 2271: (250-255): Built-in binary operator < cannot be applied to types bool and bool. +// TypeError 2271: (269-275): Built-in binary operator >= cannot be applied to types bool and bool. +// TypeError 2271: (289-295): Built-in binary operator <= cannot be applied to types bool and bool. +// TypeError 2271: (309-314): Built-in binary operator & cannot be applied to types bool and bool. +// TypeError 2271: (328-333): Built-in binary operator | cannot be applied to types bool and bool. +// TypeError 2271: (347-352): Built-in binary operator ^ cannot be applied to types bool and bool. // TypeError 4907: (366-368): Built-in unary operator ~ cannot be applied to type bool. // TypeError 4907: (382-384): Built-in unary operator ~ cannot be applied to type bool. -// TypeError 2271: (398-403): Binary operator + not compatible with types bool and bool. -// TypeError 2271: (417-422): Binary operator - not compatible with types bool and bool. +// TypeError 2271: (398-403): Built-in binary operator + cannot be applied to types bool and bool. +// TypeError 2271: (417-422): Built-in binary operator - cannot be applied to types bool and bool. // TypeError 4907: (436-438): Built-in unary operator - cannot be applied to type bool. // TypeError 4907: (452-454): Built-in unary operator - cannot be applied to type bool. -// TypeError 2271: (468-473): Binary operator * not compatible with types bool and bool. -// TypeError 2271: (487-492): Binary operator / not compatible with types bool and bool. -// TypeError 2271: (506-512): Binary operator ** not compatible with types bool and bool. -// TypeError 2271: (526-531): Binary operator % not compatible with types bool and bool. -// TypeError 2271: (545-551): Binary operator << not compatible with types bool and bool. -// TypeError 2271: (565-571): Binary operator >> not compatible with types bool and bool. +// TypeError 2271: (468-473): Built-in binary operator * cannot be applied to types bool and bool. +// TypeError 2271: (487-492): Built-in binary operator / cannot be applied to types bool and bool. +// TypeError 2271: (506-512): Built-in binary operator ** cannot be applied to types bool and bool. +// TypeError 2271: (526-531): Built-in binary operator % cannot be applied to types bool and bool. +// TypeError 2271: (545-551): Built-in binary operator << cannot be applied to types bool and bool. +// TypeError 2271: (565-571): Built-in binary operator >> cannot be applied to types bool and bool. diff --git a/test/libsolidity/syntaxTests/types/rational_number_bitshift_limit.sol b/test/libsolidity/syntaxTests/types/rational_number_bitshift_limit.sol index f14a54e03..801773db2 100644 --- a/test/libsolidity/syntaxTests/types/rational_number_bitshift_limit.sol +++ b/test/libsolidity/syntaxTests/types/rational_number_bitshift_limit.sol @@ -8,6 +8,6 @@ contract c { } // ---- // TypeError 7407: (71-80): Type int_const 5221...(1225 digits omitted)...5168 is not implicitly convertible to expected type int256. Literal is too large to fit in int256. -// TypeError 2271: (133-142): Binary operator << not compatible with types int_const 1 and int_const 4096. -// TypeError 2271: (169-182): Binary operator << not compatible with types int_const 1000...(1226 digits omitted)...0000 and int_const 2. +// TypeError 2271: (133-142): Built-in binary operator << cannot be applied to types int_const 1 and int_const 4096. +// TypeError 2271: (169-182): Built-in binary operator << cannot be applied to types int_const 1000...(1226 digits omitted)...0000 and int_const 2. // TypeError 7407: (169-182): Type int_const 1000...(1226 digits omitted)...0000 is not implicitly convertible to expected type int256. Literal is too large to fit in int256. diff --git a/test/libsolidity/syntaxTests/types/rational_number_div_limit.sol b/test/libsolidity/syntaxTests/types/rational_number_div_limit.sol index 50da39a81..ae42d5e5e 100644 --- a/test/libsolidity/syntaxTests/types/rational_number_div_limit.sol +++ b/test/libsolidity/syntaxTests/types/rational_number_div_limit.sol @@ -5,5 +5,5 @@ contract c { } } // ---- -// TypeError 2271: (71-92): Binary operator / not compatible with types rational_const 1 / 5221...(1225 digits omitted)...5168 and int_const 5221...(1225 digits omitted)...5168. Precision of rational constants is limited to 4096 bits. +// TypeError 2271: (71-92): Built-in binary operator / cannot be applied to types rational_const 1 / 5221...(1225 digits omitted)...5168 and int_const 5221...(1225 digits omitted)...5168. Precision of rational constants is limited to 4096 bits. // TypeError 2326: (71-92): Type rational_const 1 / 5221...(1225 digits omitted)...5168 is not implicitly convertible to expected type int256. Try converting to type ufixed8x80 or use an explicit conversion. diff --git a/test/libsolidity/syntaxTests/types/rational_number_exp_limit_fail.sol b/test/libsolidity/syntaxTests/types/rational_number_exp_limit_fail.sol index bdda1a37f..fb029202f 100644 --- a/test/libsolidity/syntaxTests/types/rational_number_exp_limit_fail.sol +++ b/test/libsolidity/syntaxTests/types/rational_number_exp_limit_fail.sol @@ -19,29 +19,29 @@ contract c { } } // ---- -// TypeError 2271: (71-112): Binary operator ** not compatible with types int_const 1797...(301 digits omitted)...7216 and int_const 4. +// TypeError 2271: (71-112): Built-in binary operator ** cannot be applied to types int_const 1797...(301 digits omitted)...7216 and int_const 4. // TypeError 7407: (71-112): Type int_const 1797...(301 digits omitted)...7216 is not implicitly convertible to expected type int256. Literal is too large to fit in int256. -// TypeError 2271: (135-151): Binary operator ** not compatible with types int_const 4 and int_const 1157...(70 digits omitted)...9936. +// TypeError 2271: (135-151): Built-in binary operator ** cannot be applied to types int_const 4 and int_const 1157...(70 digits omitted)...9936. // TypeError 7407: (126-169): Type int_const 1340...(147 digits omitted)...4096 is not implicitly convertible to expected type int256. Literal is too large to fit in int256. -// TypeError 2271: (201-217): Binary operator ** not compatible with types int_const 4 and int_const 1340...(147 digits omitted)...4096. -// TypeError 2271: (183-219): Binary operator ** not compatible with types int_const 4 and int_const -115...(71 digits omitted)...9936. -// TypeError 2271: (233-244): Binary operator ** not compatible with types int_const 2 and int_const 1000...(1226 digits omitted)...0000. -// TypeError 2271: (258-270): Binary operator ** not compatible with types int_const -2 and int_const 1000...(1226 digits omitted)...0000. -// TypeError 2271: (284-296): Binary operator ** not compatible with types int_const 2 and int_const -100...(1227 digits omitted)...0000. -// TypeError 2271: (310-323): Binary operator ** not compatible with types int_const -2 and int_const -100...(1227 digits omitted)...0000. -// TypeError 2271: (337-348): Binary operator ** not compatible with types int_const 1000...(1226 digits omitted)...0000 and int_const 2. +// TypeError 2271: (201-217): Built-in binary operator ** cannot be applied to types int_const 4 and int_const 1340...(147 digits omitted)...4096. +// TypeError 2271: (183-219): Built-in binary operator ** cannot be applied to types int_const 4 and int_const -115...(71 digits omitted)...9936. +// TypeError 2271: (233-244): Built-in binary operator ** cannot be applied to types int_const 2 and int_const 1000...(1226 digits omitted)...0000. +// TypeError 2271: (258-270): Built-in binary operator ** cannot be applied to types int_const -2 and int_const 1000...(1226 digits omitted)...0000. +// TypeError 2271: (284-296): Built-in binary operator ** cannot be applied to types int_const 2 and int_const -100...(1227 digits omitted)...0000. +// TypeError 2271: (310-323): Built-in binary operator ** cannot be applied to types int_const -2 and int_const -100...(1227 digits omitted)...0000. +// TypeError 2271: (337-348): Built-in binary operator ** cannot be applied to types int_const 1000...(1226 digits omitted)...0000 and int_const 2. // TypeError 7407: (337-348): Type int_const 1000...(1226 digits omitted)...0000 is not implicitly convertible to expected type int256. Literal is too large to fit in int256. -// TypeError 2271: (362-374): Binary operator ** not compatible with types int_const -100...(1227 digits omitted)...0000 and int_const 2. +// TypeError 2271: (362-374): Built-in binary operator ** cannot be applied to types int_const -100...(1227 digits omitted)...0000 and int_const 2. // TypeError 7407: (362-374): Type int_const -100...(1227 digits omitted)...0000 is not implicitly convertible to expected type int256. Literal is too large to fit in int256. -// TypeError 2271: (388-400): Binary operator ** not compatible with types int_const 1000...(1226 digits omitted)...0000 and int_const -2. +// TypeError 2271: (388-400): Built-in binary operator ** cannot be applied to types int_const 1000...(1226 digits omitted)...0000 and int_const -2. // TypeError 7407: (388-400): Type int_const 1000...(1226 digits omitted)...0000 is not implicitly convertible to expected type int256. Literal is too large to fit in int256. -// TypeError 2271: (414-427): Binary operator ** not compatible with types int_const -100...(1227 digits omitted)...0000 and int_const -2. +// TypeError 2271: (414-427): Built-in binary operator ** cannot be applied to types int_const -100...(1227 digits omitted)...0000 and int_const -2. // TypeError 7407: (414-427): Type int_const -100...(1227 digits omitted)...0000 is not implicitly convertible to expected type int256. Literal is too large to fit in int256. -// TypeError 2271: (441-457): Binary operator ** not compatible with types int_const 1000...(1226 digits omitted)...0000 and int_const 1000...(1226 digits omitted)...0000. +// TypeError 2271: (441-457): Built-in binary operator ** cannot be applied to types int_const 1000...(1226 digits omitted)...0000 and int_const 1000...(1226 digits omitted)...0000. // TypeError 7407: (441-457): Type int_const 1000...(1226 digits omitted)...0000 is not implicitly convertible to expected type int256. Literal is too large to fit in int256. -// TypeError 2271: (471-488): Binary operator ** not compatible with types int_const 1000...(1226 digits omitted)...0000 and int_const -100...(1227 digits omitted)...0000. +// TypeError 2271: (471-488): Built-in binary operator ** cannot be applied to types int_const 1000...(1226 digits omitted)...0000 and int_const -100...(1227 digits omitted)...0000. // TypeError 7407: (471-488): Type int_const 1000...(1226 digits omitted)...0000 is not implicitly convertible to expected type int256. Literal is too large to fit in int256. -// TypeError 2271: (502-519): Binary operator ** not compatible with types int_const -100...(1227 digits omitted)...0000 and int_const 1000...(1226 digits omitted)...0000. +// TypeError 2271: (502-519): Built-in binary operator ** cannot be applied to types int_const -100...(1227 digits omitted)...0000 and int_const 1000...(1226 digits omitted)...0000. // TypeError 7407: (502-519): Type int_const -100...(1227 digits omitted)...0000 is not implicitly convertible to expected type int256. Literal is too large to fit in int256. -// TypeError 2271: (533-551): Binary operator ** not compatible with types int_const -100...(1227 digits omitted)...0000 and int_const -100...(1227 digits omitted)...0000. +// TypeError 2271: (533-551): Built-in binary operator ** cannot be applied to types int_const -100...(1227 digits omitted)...0000 and int_const -100...(1227 digits omitted)...0000. // TypeError 7407: (533-551): Type int_const -100...(1227 digits omitted)...0000 is not implicitly convertible to expected type int256. Literal is too large to fit in int256. diff --git a/test/libsolidity/syntaxTests/types/rational_number_mul_limit.sol b/test/libsolidity/syntaxTests/types/rational_number_mul_limit.sol index 83232d982..c23569c95 100644 --- a/test/libsolidity/syntaxTests/types/rational_number_mul_limit.sol +++ b/test/libsolidity/syntaxTests/types/rational_number_mul_limit.sol @@ -5,5 +5,5 @@ contract c { } } // ---- -// TypeError 2271: (71-90): Binary operator * not compatible with types int_const 5221...(1225 digits omitted)...5168 and int_const 5221...(1225 digits omitted)...5168. Precision of rational constants is limited to 4096 bits. +// TypeError 2271: (71-90): Built-in binary operator * cannot be applied to types int_const 5221...(1225 digits omitted)...5168 and int_const 5221...(1225 digits omitted)...5168. Precision of rational constants is limited to 4096 bits. // TypeError 7407: (71-90): Type int_const 5221...(1225 digits omitted)...5168 is not implicitly convertible to expected type int256. Literal is too large to fit in int256. diff --git a/test/libsolidity/syntaxTests/using/override_user_type_operator_defined_as_global.sol b/test/libsolidity/syntaxTests/using/override_user_type_operator_defined_as_global.sol index 293ce0878..1477ec0df 100644 --- a/test/libsolidity/syntaxTests/using/override_user_type_operator_defined_as_global.sol +++ b/test/libsolidity/syntaxTests/using/override_user_type_operator_defined_as_global.sol @@ -21,4 +21,4 @@ contract C { } } // ---- -// TypeError 2271: (s2.sol:184-209): Binary operator + not compatible with types Int and Int. Multiple user-defined functions provided for this operator. +// TypeError 2271: (s2.sol:184-209): Built-in binary operator + cannot be applied to types Int and Int. Multiple user-defined functions provided for this operator. diff --git a/test/libsolidity/syntaxTests/using/two_functions_bound_to_the_same_binary_operator_as_global_and_non_global.sol b/test/libsolidity/syntaxTests/using/two_functions_bound_to_the_same_binary_operator_as_global_and_non_global.sol index 573cc7f1a..c2db2735c 100644 --- a/test/libsolidity/syntaxTests/using/two_functions_bound_to_the_same_binary_operator_as_global_and_non_global.sol +++ b/test/libsolidity/syntaxTests/using/two_functions_bound_to_the_same_binary_operator_as_global_and_non_global.sol @@ -17,4 +17,4 @@ function test() pure returns (Int) { } // ---- -// TypeError 2271: (s1.sol:284-309): Binary operator + not compatible with types Int and Int. Multiple user-defined functions provided for this operator. +// TypeError 2271: (s1.sol:284-309): Built-in binary operator + cannot be applied to types Int and Int. Multiple user-defined functions provided for this operator. diff --git a/test/libsolidity/syntaxTests/using/user_type_operator_defined_as_global.sol b/test/libsolidity/syntaxTests/using/user_type_operator_defined_as_global.sol index 47513b7d6..dffcaec3a 100644 --- a/test/libsolidity/syntaxTests/using/user_type_operator_defined_as_global.sol +++ b/test/libsolidity/syntaxTests/using/user_type_operator_defined_as_global.sol @@ -20,4 +20,4 @@ contract C { } } // ---- -// TypeError 2271: (s2.sol:104-129): Binary operator - not compatible with types Int and Int. No matching user-defined operator found. +// TypeError 2271: (s2.sol:104-129): Built-in binary operator - cannot be applied to types Int and Int. No matching user-defined operator found.