mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add test: operator_parameter_with_wrong_data_location
This commit is contained in:
parent
61075e28db
commit
8272da0aea
@ -403,7 +403,6 @@ FunctionDefinition const* Type::userDefinedOperator(Token _token, ASTNode const&
|
||||
function.libraryFunction() ? function.typeViaContractName() : function.type()
|
||||
);
|
||||
solAssert(functionType && !functionType->parameterTypes().empty());
|
||||
// TODO does this work (data location)?
|
||||
solAssert(isImplicitlyConvertibleTo(*functionType->parameterTypes().front()));
|
||||
if ((_unaryOperation && function.parameterList().parameters().size() == 1) ||
|
||||
(!_unaryOperation && function.parameterList().parameters().size() == 2))
|
||||
|
@ -0,0 +1,10 @@
|
||||
struct S { uint128 x; }
|
||||
|
||||
using {add as +} for S;
|
||||
|
||||
function add(S memory, S storage) returns (S memory) {
|
||||
return S(0);
|
||||
}
|
||||
|
||||
// ----
|
||||
// TypeError 1884: (32-35): The function "add" needs to have two parameters of equal type to be used for the operator +.
|
Loading…
Reference in New Issue
Block a user