diff --git a/libsolidity/analysis/DeclarationTypeChecker.cpp b/libsolidity/analysis/DeclarationTypeChecker.cpp index 54a7354e2..208829387 100644 --- a/libsolidity/analysis/DeclarationTypeChecker.cpp +++ b/libsolidity/analysis/DeclarationTypeChecker.cpp @@ -190,7 +190,7 @@ void DeclarationTypeChecker::endVisit(UserDefinedTypeName const& _typeName) m_errorReporter.fatalTypeError( 5172_error, _typeName.location(), - "Name has to refer to a struct, enum or contract." + "Name has to refer to a user-defined type." ); } } diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 1025e6576..0e2cc6c34 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -40,6 +40,8 @@ #include #include +#include + #include #include #include @@ -1731,7 +1733,13 @@ bool TypeChecker::visit(UnaryOperation const& _operation) TypeResult result = type(_operation.subExpression())->unaryOperatorResult(op); if (!result) { - string description = "Unary operator " + string(TokenTraits::toString(op)) + " cannot be applied to type " + subExprType->humanReadableName() + "." + (!result.message().empty() ? " " + result.message() : ""); + string description = fmt::format( + "Built-in unary operator {} cannot be applied to type {}.{}", + TokenTraits::toString(op), + subExprType->humanReadableName(), + !result.message().empty() ? " " + result.message() : "" + ); + if (modifying) // Cannot just report the error, ignore the unary operator, and continue, // because the sub-expression was already processed with requireLValue() @@ -1760,9 +1768,9 @@ void TypeChecker::endVisit(BinaryOperation const& _operation) m_errorReporter.typeError( 2271_error, _operation.location(), - "Operator " + + "Built-in binary operator " + string(TokenTraits::toString(_operation.getOperator())) + - " not compatible with types " + + " cannot be applied to types " + leftType->humanReadableName() + " and " + rightType->humanReadableName() + "." + @@ -3796,9 +3804,11 @@ void TypeChecker::endVisit(UsingForDirective const& _usingFor) m_errorReporter.fatalTypeError( 4731_error, path->location(), - "The function \"" + joinHumanReadable(path->path(), ".") + "\" " + - "does not have any parameters, and therefore cannot be bound to the type \"" + - (normalizedType ? normalizedType->humanReadableName() : "*") + "\"." + fmt::format( + "The function \"{}\" does not have any parameters, and therefore cannot be bound to the type \"{}\".", + joinHumanReadable(path->path(), "."), + normalizedType ? normalizedType->toString(true /* withoutDataLocation */) : "*" + ) ); FunctionType const* functionType = dynamic_cast(*functionDefinition.type()).asBoundFunction(); @@ -3810,14 +3820,13 @@ void TypeChecker::endVisit(UsingForDirective const& _usingFor) m_errorReporter.typeError( 3100_error, path->location(), - "The function \"" + joinHumanReadable(path->path(), ".") + "\" "+ - "cannot be bound to the type \"" + _usingFor.typeName()->annotation().type->humanReadableName() + - "\" because the type cannot be implicitly converted to the first argument" + - " of the function (\"" + functionType->selfType()->humanReadableName() + "\")" + - ( - result.message().empty() ? - "." : - ": " + result.message() + fmt::format( + "The function \"{}\" cannot be bound to the type \"{}\" because the type cannot " + "be implicitly converted to the first argument of the function (\"{}\"){}", + joinHumanReadable(path->path(), "."), + _usingFor.typeName()->annotation().type->toString(true /* withoutDataLocation */), + functionType->selfType()->humanReadableName(), + result.message().empty() ? "." : ": " + result.message() ) ); } 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 cd98edf6c..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): 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): 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): Unary operator ! cannot be applied to type tuple(). +// 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 8087b6b33..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): Operator != not compatible with types type(contract super C) and contract C. -// TypeError 2271: (167-180): Operator != not compatible with types contract C and type(contract super C). -// TypeError 2271: (254-264): Operator != not compatible with types type(contract super C) and contract C. -// TypeError 2271: (274-284): Operator != not compatible with types contract C and type(contract super C). -// TypeError 2271: (349-359): Operator != not compatible with types type(contract super C) and contract D. -// TypeError 2271: (369-379): 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 045611306..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): Operator << not compatible with types type(contract super C) and contract C. -// TypeError 2271: (72-85): Operator >> not compatible with types type(contract super C) and contract C. -// TypeError 2271: (95-107): Operator ^ not compatible with types type(contract super C) and contract C. -// TypeError 2271: (117-129): Operator | not compatible with types type(contract super C) and contract C. -// TypeError 2271: (139-151): Operator & not compatible with types type(contract super C) and contract C. -// TypeError 2271: (162-174): Operator * not compatible with types type(contract super C) and contract C. -// TypeError 2271: (184-196): Operator / not compatible with types type(contract super C) and contract C. -// TypeError 2271: (206-218): Operator % not compatible with types type(contract super C) and contract C. -// TypeError 2271: (228-240): Operator - not compatible with types type(contract super C) and contract C. -// TypeError 2271: (250-262): Operator + not compatible with types type(contract super C) and contract C. -// TypeError 2271: (272-285): Operator ** not compatible with types type(contract super C) and contract C. -// TypeError 2271: (296-309): Operator == not compatible with types type(contract super C) and contract C. -// TypeError 2271: (319-332): Operator != not compatible with types type(contract super C) and contract C. -// TypeError 2271: (342-355): Operator >= not compatible with types type(contract super C) and contract C. -// TypeError 2271: (365-378): Operator <= not compatible with types type(contract super C) and contract C. -// TypeError 2271: (388-400): Operator < not compatible with types type(contract super C) and contract C. -// TypeError 2271: (410-422): Operator > not compatible with types type(contract super C) and contract C. -// TypeError 2271: (433-446): Operator || not compatible with types type(contract super C) and contract C. -// TypeError 2271: (456-469): 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_as_function_param.sol b/test/libsolidity/syntaxTests/errors/error_as_function_param.sol index 3741687f6..79f28a008 100644 --- a/test/libsolidity/syntaxTests/errors/error_as_function_param.sol +++ b/test/libsolidity/syntaxTests/errors/error_as_function_param.sol @@ -1,4 +1,4 @@ error E(uint); function f(E x) pure returns (uint) {} // ---- -// TypeError 5172: (26-27): Name has to refer to a struct, enum or contract. +// TypeError 5172: (26-27): Name has to refer to a user-defined type. diff --git a/test/libsolidity/syntaxTests/errors/error_incompatible_binary_ops.sol b/test/libsolidity/syntaxTests/errors/error_incompatible_binary_ops.sol index 3f18bbf19..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): Operator << not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (126-156): Operator >> not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (166-195): Operator ^ not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (205-234): Operator | not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (244-273): Operator & not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (284-313): Operator * not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (323-352): Operator / not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (362-391): Operator % not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (401-430): Operator + not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (440-469): Operator - not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (480-510): Operator == not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (520-550): Operator != not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (560-590): Operator >= not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (600-630): Operator <= not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (640-669): Operator < not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (679-708): Operator > not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (719-749): Operator || not compatible with types error MyCustomError(uint256,bool) and error MyCustomError(uint256,bool). -// TypeError 2271: (759-789): 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/errors/error_incompatible_unary_operator.sol b/test/libsolidity/syntaxTests/errors/error_incompatible_unary_operator.sol index f4bc34ca4..147d2a3e6 100644 --- a/test/libsolidity/syntaxTests/errors/error_incompatible_unary_operator.sol +++ b/test/libsolidity/syntaxTests/errors/error_incompatible_unary_operator.sol @@ -8,4 +8,4 @@ contract C { // ---- // TypeError 4247: (86-99): Expression has to be an lvalue. -// TypeError 9767: (86-101): Unary operator ++ cannot be applied to type error MyCustomError(uint256,bool). +// TypeError 9767: (86-101): Built-in unary operator ++ cannot be applied to type error MyCustomError(uint256,bool). diff --git a/test/libsolidity/syntaxTests/errors/using_2.sol b/test/libsolidity/syntaxTests/errors/using_2.sol index 2f60f3d04..6942513a1 100644 --- a/test/libsolidity/syntaxTests/errors/using_2.sol +++ b/test/libsolidity/syntaxTests/errors/using_2.sol @@ -9,4 +9,4 @@ contract C { } } // ---- -// TypeError 5172: (91-92): Name has to refer to a struct, enum or contract. +// TypeError 5172: (91-92): Name has to refer to a user-defined type. diff --git a/test/libsolidity/syntaxTests/errors/weird3.sol b/test/libsolidity/syntaxTests/errors/weird3.sol index c81266969..a059339c6 100644 --- a/test/libsolidity/syntaxTests/errors/weird3.sol +++ b/test/libsolidity/syntaxTests/errors/weird3.sol @@ -4,4 +4,4 @@ contract C { E x; } // ---- -// TypeError 5172: (29-30): Name has to refer to a struct, enum or contract. +// TypeError 5172: (29-30): Name has to refer to a user-defined type. diff --git a/test/libsolidity/syntaxTests/errors/weird4.sol b/test/libsolidity/syntaxTests/errors/weird4.sol index be1ef90b6..c4fff3747 100644 --- a/test/libsolidity/syntaxTests/errors/weird4.sol +++ b/test/libsolidity/syntaxTests/errors/weird4.sol @@ -6,4 +6,4 @@ contract C { } } // ---- -// TypeError 5172: (64-65): Name has to refer to a struct, enum or contract. +// TypeError 5172: (64-65): Name has to refer to a user-defined type. diff --git a/test/libsolidity/syntaxTests/events/event_incompatible_binary_ops.sol b/test/libsolidity/syntaxTests/events/event_incompatible_binary_ops.sol index 1537f8edf..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): Operator << not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (123-153): Operator >> not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (163-192): Operator ^ not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (202-231): Operator | not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (241-270): Operator & not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (281-310): Operator * not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (320-349): Operator / not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (359-388): Operator % not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (398-427): Operator + not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (437-466): Operator - not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (477-507): Operator == not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (517-547): Operator != not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (557-587): Operator >= not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (597-627): Operator <= not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (637-666): Operator < not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (676-705): Operator > not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (716-746): Operator || not compatible with types event MyCustomEvent(uint256) and event MyCustomEvent(uint256). -// TypeError 2271: (756-786): 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/events/event_incompatible_unary_operator.sol b/test/libsolidity/syntaxTests/events/event_incompatible_unary_operator.sol index 110b8d214..751be2132 100644 --- a/test/libsolidity/syntaxTests/events/event_incompatible_unary_operator.sol +++ b/test/libsolidity/syntaxTests/events/event_incompatible_unary_operator.sol @@ -7,4 +7,4 @@ contract C { // ---- // TypeError 4247: (83-96): Expression has to be an lvalue. -// TypeError 9767: (83-98): Unary operator ++ cannot be applied to type event MyCustomEvent(uint256). +// TypeError 9767: (83-98): Built-in unary operator ++ cannot be applied to type 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 67911852f..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): 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 bc3882fdd..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): 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 e924893f0..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): 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 16dc981ad..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): 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 824f2dbf8..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): Operator == not compatible with types function () external and function () external. -// TypeError 2271: (277-351): 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 a562b2d3f..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): Operator != not compatible with types function () and function () external. -// TypeError 2271: (688-741): 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 93facedb0..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): Operator == not compatible with types function (uint256) external and function () external. -// TypeError 2271: (538-602): Operator == not compatible with types function (bool) external and function () external. -// TypeError 2271: (726-786): 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/iceRegressionTests/declarationUnaryTuple/declaration_dec_tuple.sol b/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_dec_tuple.sol index fa1950d92..9398ef473 100644 --- a/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_dec_tuple.sol +++ b/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_dec_tuple.sol @@ -6,4 +6,4 @@ contract C } } // ---- -// TypeError 9767: (59-64): Unary operator -- cannot be applied to type tuple(,). +// TypeError 9767: (59-64): Built-in unary operator -- cannot be applied to type tuple(,). diff --git a/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_delete_tuple.sol b/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_delete_tuple.sol index c73fe7435..649eae56f 100644 --- a/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_delete_tuple.sol +++ b/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_delete_tuple.sol @@ -7,4 +7,4 @@ contract C } // ---- // TypeError 4247: (68-69): Expression has to be an lvalue. -// TypeError 9767: (59-70): Unary operator delete cannot be applied to type tuple(,int_const 0). +// TypeError 9767: (59-70): Built-in unary operator delete cannot be applied to type tuple(,int_const 0). diff --git a/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_inc_tuple.sol b/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_inc_tuple.sol index 3cbab1423..2f20a6216 100644 --- a/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_inc_tuple.sol +++ b/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_inc_tuple.sol @@ -6,4 +6,4 @@ contract C } } // ---- -// TypeError 9767: (61-66): Unary operator ++ cannot be applied to type tuple(,). +// TypeError 9767: (61-66): Built-in unary operator ++ cannot be applied to type tuple(,). diff --git a/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_unary_tuple.sol b/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_unary_tuple.sol index 01056ffe2..b6b2ec2e2 100644 --- a/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_unary_tuple.sol +++ b/test/libsolidity/syntaxTests/iceRegressionTests/declarationUnaryTuple/declaration_unary_tuple.sol @@ -10,11 +10,11 @@ contract C } // ---- // SyntaxError 9636: (59-66): Use of unary + is disallowed. -// TypeError 4907: (59-66): Unary operator + cannot be applied to type tuple(int_const 0,int_const 0). +// TypeError 4907: (59-66): Built-in unary operator + cannot be applied to type tuple(int_const 0,int_const 0). // TypeError 7364: (51-66): Different number of components on the left hand side (1) than on the right hand side (2). -// TypeError 4907: (84-91): Unary operator - cannot be applied to type tuple(int_const 0,int_const 0). +// TypeError 4907: (84-91): Built-in unary operator - cannot be applied to type tuple(int_const 0,int_const 0). // TypeError 7364: (76-91): Different number of components on the left hand side (1) than on the right hand side (2). -// TypeError 4907: (111-118): Unary operator ~ cannot be applied to type tuple(int_const 0,int_const 0). +// TypeError 4907: (111-118): Built-in unary operator ~ cannot be applied to type tuple(int_const 0,int_const 0). // TypeError 7364: (101-118): Different number of components on the left hand side (1) than on the right hand side (2). -// TypeError 4907: (138-145): Unary operator ! cannot be applied to type tuple(int_const 0,int_const 0). +// TypeError 4907: (138-145): Built-in unary operator ! cannot be applied to type tuple(int_const 0,int_const 0). // TypeError 7364: (128-145): Different number of components on the left hand side (1) than on the right hand side (2). diff --git a/test/libsolidity/syntaxTests/iceRegressionTests/identifier_collision_return_declare.sol b/test/libsolidity/syntaxTests/iceRegressionTests/identifier_collision_return_declare.sol index b2d10d205..aa5aeec48 100644 --- a/test/libsolidity/syntaxTests/iceRegressionTests/identifier_collision_return_declare.sol +++ b/test/libsolidity/syntaxTests/iceRegressionTests/identifier_collision_return_declare.sol @@ -2,4 +2,4 @@ contract C { function ( uint ) external returns ( a [ ] calldata ) public a = ( 1 / 2 ) ; } // ---- -// TypeError 5172: (58-59): Name has to refer to a struct, enum or contract. +// TypeError 5172: (58-59): Name has to refer to a user-defined type. diff --git a/test/libsolidity/syntaxTests/literalOperations/division_by_zero.sol b/test/libsolidity/syntaxTests/literalOperations/division_by_zero.sol index 211eabac2..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): 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 afa0896fa..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): 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 c3469054c..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): Operator ** not compatible with types int256 and int_const 1000...(1226 digits omitted)...0000. Exponent too large. -// TypeError 2271: (88-98): 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 28f95e332..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): 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 54b6b309b..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): 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 b098a8602..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): 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 528635b98..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): 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 7849588a4..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): 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 0dfeb892a..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): 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 24c6ce13c..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): 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 1d1298b05..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): 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/198_integer_boolean_not.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/198_integer_boolean_not.sol index c4fff97b4..83c39fbda 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/198_integer_boolean_not.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/198_integer_boolean_not.sol @@ -1,3 +1,3 @@ contract test { fallback() external { uint x = 1; !x; } } // ---- -// TypeError 4907: (50-52): Unary operator ! cannot be applied to type uint256. +// TypeError 4907: (50-52): Built-in unary operator ! cannot be applied to type 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 cabe9aa13..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): 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 188dda39c..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): Operator ** not compatible with types int256 and int256. Exponentiation power is not allowed to be a signed integer type. -// TypeError 2271: (126-132): 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): 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 60dffe643..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): 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 822db8dd5..930e79a3b 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): Operator == not compatible with types struct test.s storage ref and struct test.s storage ref. +// TypeError 2271: (79-85): Built-in binary operator == cannot be applied to types struct test.s storage ref and struct test.s storage ref. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/213_no_delete_on_storage_pointers.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/213_no_delete_on_storage_pointers.sol index e0db21efa..7d452197e 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/213_no_delete_on_storage_pointers.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/213_no_delete_on_storage_pointers.sol @@ -6,4 +6,4 @@ contract C { } } // ---- -// TypeError 9767: (97-105): Unary operator delete cannot be applied to type uint256[] storage pointer. +// TypeError 9767: (97-105): Built-in unary operator delete cannot be applied to type uint256[] storage pointer. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/291_modifier_is_not_a_valid_typename.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/291_modifier_is_not_a_valid_typename.sol index 0c7b80e03..30f240c1e 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/291_modifier_is_not_a_valid_typename.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/291_modifier_is_not_a_valid_typename.sol @@ -6,4 +6,4 @@ contract test { } } // ---- -// TypeError 5172: (77-80): Name has to refer to a struct, enum or contract. +// TypeError 5172: (77-80): Name has to refer to a user-defined type. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/292_modifier_is_not_a_valid_typename_is_not_fatal.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/292_modifier_is_not_a_valid_typename_is_not_fatal.sol index 589772a9d..92d777550 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/292_modifier_is_not_a_valid_typename_is_not_fatal.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/292_modifier_is_not_a_valid_typename_is_not_fatal.sol @@ -7,4 +7,4 @@ contract test { } } // ---- -// TypeError 5172: (77-80): Name has to refer to a struct, enum or contract. +// TypeError 5172: (77-80): Name has to refer to a user-defined type. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/293_function_is_not_a_valid_typename.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/293_function_is_not_a_valid_typename.sol index c1cb83e47..66ff7cf35 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/293_function_is_not_a_valid_typename.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/293_function_is_not_a_valid_typename.sol @@ -7,4 +7,4 @@ contract test { } } // ---- -// TypeError 5172: (85-88): Name has to refer to a struct, enum or contract. +// TypeError 5172: (85-88): Name has to refer to a user-defined type. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/308_rational_unary_plus_operation.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/308_rational_unary_plus_operation.sol index eeaa66ebc..0c579062b 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/308_rational_unary_plus_operation.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/308_rational_unary_plus_operation.sol @@ -7,4 +7,4 @@ contract test { } // ---- // SyntaxError 9636: (70-75): Use of unary + is disallowed. -// TypeError 4907: (70-75): Unary operator + cannot be applied to type rational_const 13 / 4. +// TypeError 4907: (70-75): Built-in unary operator + cannot be applied to type rational_const 13 / 4. 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 47a1a617f..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): 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 0f93157ed..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): 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 721ca806e..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): 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 6408f13c6..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): 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 f988745ea..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): 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 68e80e635..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): 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/338_rational_bitnot_unary_operation.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/338_rational_bitnot_unary_operation.sol index 4bf484ff1..46cda0a1c 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/338_rational_bitnot_unary_operation.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/338_rational_bitnot_unary_operation.sol @@ -4,4 +4,4 @@ contract test { } } // ---- -// TypeError 4907: (50-61): Unary operator ~ cannot be applied to type fixed128x18. +// TypeError 4907: (50-61): Built-in unary operator ~ cannot be applied to type fixed128x18. 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 66f5e620a..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): 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 791e1480c..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): 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 9e49de99b..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): 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 aaa0903b6..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): 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 edfb03d3d..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): 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 17e7cc719..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): 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 f96eeab2d..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): 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 8f005b9ec..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): 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/negation.sol b/test/libsolidity/syntaxTests/negation.sol index 4a9d87b8a..c5805f4f7 100644 --- a/test/libsolidity/syntaxTests/negation.sol +++ b/test/libsolidity/syntaxTests/negation.sol @@ -6,4 +6,4 @@ contract test { } } // ---- -// TypeError 4907: (97-99): Unary operator - cannot be applied to type uint256. Unary negation is only allowed for signed integers. +// TypeError 4907: (97-99): Built-in unary operator - cannot be applied to type uint256. Unary negation is only allowed for signed integers. diff --git a/test/libsolidity/syntaxTests/parsing/unary_plus_expression.sol b/test/libsolidity/syntaxTests/parsing/unary_plus_expression.sol index 7005c8848..41384d98f 100644 --- a/test/libsolidity/syntaxTests/parsing/unary_plus_expression.sol +++ b/test/libsolidity/syntaxTests/parsing/unary_plus_expression.sol @@ -6,4 +6,4 @@ contract test { } // ---- // SyntaxError 9636: (70-72): Use of unary + is disallowed. -// TypeError 4907: (70-72): Unary operator + cannot be applied to type uint256. +// TypeError 4907: (70-72): Built-in unary operator + cannot be applied to type uint256. diff --git a/test/libsolidity/syntaxTests/scoping/name_shadowing_function_parameter_vs_struct_enum.sol b/test/libsolidity/syntaxTests/scoping/name_shadowing_function_parameter_vs_struct_enum.sol index 61441ece6..5c63f6529 100644 --- a/test/libsolidity/syntaxTests/scoping/name_shadowing_function_parameter_vs_struct_enum.sol +++ b/test/libsolidity/syntaxTests/scoping/name_shadowing_function_parameter_vs_struct_enum.sol @@ -17,4 +17,4 @@ contract C { // Warning 2519: (207-226): This declaration shadows an existing declaration. // Warning 2519: (228-254): This declaration shadows an existing declaration. // Warning 2519: (314-327): This declaration shadows an existing declaration. -// TypeError 5172: (104-114): Name has to refer to a struct, enum or contract. +// TypeError 5172: (104-114): Name has to refer to a user-defined type. diff --git a/test/libsolidity/syntaxTests/scoping/name_shadowing_function_return_parameter_vs_struct_enum.sol b/test/libsolidity/syntaxTests/scoping/name_shadowing_function_return_parameter_vs_struct_enum.sol index ed4b2e0d2..8afde6952 100644 --- a/test/libsolidity/syntaxTests/scoping/name_shadowing_function_return_parameter_vs_struct_enum.sol +++ b/test/libsolidity/syntaxTests/scoping/name_shadowing_function_return_parameter_vs_struct_enum.sol @@ -17,4 +17,4 @@ contract C { // Warning 2519: (249-268): This declaration shadows an existing declaration. // Warning 2519: (270-296): This declaration shadows an existing declaration. // Warning 2519: (317-330): This declaration shadows an existing declaration. -// TypeError 5172: (124-134): Name has to refer to a struct, enum or contract. +// TypeError 5172: (124-134): Name has to refer to a user-defined type. diff --git a/test/libsolidity/syntaxTests/shifts/shift_singed_rvalue.sol b/test/libsolidity/syntaxTests/shifts/shift_singed_rvalue.sol index 87a2dee81..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): Operator >> not compatible with types int256 and int256. -// TypeError 2271: (179-193): 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 999086ae1..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): 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/structs/member_type_func.sol b/test/libsolidity/syntaxTests/structs/member_type_func.sol index 1200fa7af..dca3086fe 100644 --- a/test/libsolidity/syntaxTests/structs/member_type_func.sol +++ b/test/libsolidity/syntaxTests/structs/member_type_func.sol @@ -4,4 +4,4 @@ contract C { function g(function(S memory) external) public {} } // ---- -// TypeError 5172: (50-51): Name has to refer to a struct, enum or contract. +// TypeError 5172: (50-51): Name has to refer to a user-defined type. diff --git a/test/libsolidity/syntaxTests/types/address/address_binary_operators.sol b/test/libsolidity/syntaxTests/types/address/address_binary_operators.sol index f26eed18a..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): 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): 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): 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): 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 b107c979a..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): Operator > not compatible with types bool and bool. -// TypeError 2271: (250-255): Operator < not compatible with types bool and bool. -// TypeError 2271: (269-275): Operator >= not compatible with types bool and bool. -// TypeError 2271: (289-295): Operator <= not compatible with types bool and bool. -// TypeError 2271: (309-314): Operator & not compatible with types bool and bool. -// TypeError 2271: (328-333): Operator | not compatible with types bool and bool. -// TypeError 2271: (347-352): Operator ^ not compatible with types bool and bool. -// TypeError 4907: (366-368): Unary operator ~ cannot be applied to type bool. -// TypeError 4907: (382-384): Unary operator ~ cannot be applied to type bool. -// TypeError 2271: (398-403): Operator + not compatible with types bool and bool. -// TypeError 2271: (417-422): Operator - not compatible with types bool and bool. -// TypeError 4907: (436-438): Unary operator - cannot be applied to type bool. -// TypeError 4907: (452-454): Unary operator - cannot be applied to type bool. -// TypeError 2271: (468-473): Operator * not compatible with types bool and bool. -// TypeError 2271: (487-492): Operator / not compatible with types bool and bool. -// TypeError 2271: (506-512): Operator ** not compatible with types bool and bool. -// TypeError 2271: (526-531): Operator % not compatible with types bool and bool. -// TypeError 2271: (545-551): Operator << not compatible with types bool and bool. -// TypeError 2271: (565-571): 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): 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): 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/constant_of_invalid_function_type.sol b/test/libsolidity/syntaxTests/types/constant_of_invalid_function_type.sol index a371cb13b..c3e58284d 100644 --- a/test/libsolidity/syntaxTests/types/constant_of_invalid_function_type.sol +++ b/test/libsolidity/syntaxTests/types/constant_of_invalid_function_type.sol @@ -4,4 +4,4 @@ contract C { } // ---- -// TypeError 5172: (77-78): Name has to refer to a struct, enum or contract. +// TypeError 5172: (77-78): Name has to refer to a user-defined type. diff --git a/test/libsolidity/syntaxTests/types/hex_literal_bitnot.sol b/test/libsolidity/syntaxTests/types/hex_literal_bitnot.sol index b5676f23c..5b24153c8 100644 --- a/test/libsolidity/syntaxTests/types/hex_literal_bitnot.sol +++ b/test/libsolidity/syntaxTests/types/hex_literal_bitnot.sol @@ -2,4 +2,4 @@ contract C { bytes32 b = ~hex"00ff11"; } // ---- -// TypeError 4907: (29-41): Unary operator ~ cannot be applied to type literal_string hex"00ff11". +// TypeError 4907: (29-41): Built-in unary operator ~ cannot be applied to type literal_string hex"00ff11". diff --git a/test/libsolidity/syntaxTests/types/rational_number_bitshift_limit.sol b/test/libsolidity/syntaxTests/types/rational_number_bitshift_limit.sol index 15146500a..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): Operator << not compatible with types int_const 1 and int_const 4096. -// TypeError 2271: (169-182): 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 388e9d398..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): 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 3ab4cdae3..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): 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): 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): Operator ** not compatible with types int_const 4 and int_const 1340...(147 digits omitted)...4096. -// TypeError 2271: (183-219): Operator ** not compatible with types int_const 4 and int_const -115...(71 digits omitted)...9936. -// TypeError 2271: (233-244): Operator ** not compatible with types int_const 2 and int_const 1000...(1226 digits omitted)...0000. -// TypeError 2271: (258-270): Operator ** not compatible with types int_const -2 and int_const 1000...(1226 digits omitted)...0000. -// TypeError 2271: (284-296): Operator ** not compatible with types int_const 2 and int_const -100...(1227 digits omitted)...0000. -// TypeError 2271: (310-323): Operator ** not compatible with types int_const -2 and int_const -100...(1227 digits omitted)...0000. -// TypeError 2271: (337-348): 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): 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): 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): 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): 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): 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): 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): 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 a02578453..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): 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/free_functions_implicit_conversion_err.sol b/test/libsolidity/syntaxTests/using/free_functions_implicit_conversion_err.sol index 36f3f3032..a1fe8c7b8 100644 --- a/test/libsolidity/syntaxTests/using/free_functions_implicit_conversion_err.sol +++ b/test/libsolidity/syntaxTests/using/free_functions_implicit_conversion_err.sol @@ -1,8 +1,14 @@ +struct S { + uint8 x; +} + function id(uint16 x) pure returns(uint16) { return x; } contract C { using {id} for uint256; + using {id} for S; } // ---- -// TypeError 3100: (85-87): The function "id" cannot be bound to the type "uint256" because the type cannot be implicitly converted to the first argument of the function ("uint16"). +// TypeError 3100: (112-114): The function "id" cannot be bound to the type "uint256" because the type cannot be implicitly converted to the first argument of the function ("uint16"). +// TypeError 3100: (140-142): The function "id" cannot be bound to the type "struct S" because the type cannot be implicitly converted to the first argument of the function ("uint16"). diff --git a/test/libsolidity/syntaxTests/using/using_free_no_parameters_struct_err.sol b/test/libsolidity/syntaxTests/using/using_free_no_parameters_struct_err.sol new file mode 100644 index 000000000..758993b16 --- /dev/null +++ b/test/libsolidity/syntaxTests/using/using_free_no_parameters_struct_err.sol @@ -0,0 +1,5 @@ +struct S { uint8 x; } +function f() {} +using {f} for S; +// ---- +// TypeError 4731: (45-46): The function "f" does not have any parameters, and therefore cannot be bound to the type "struct S".