diff options
author | Kristofer Peterson <kris@tranception.com> | 2018-10-19 05:53:59 +0800 |
---|---|---|
committer | svenski123 <svenski123@users.noreply.github.com> | 2018-11-10 00:35:54 +0800 |
commit | f927da9182f6225d5ab354d4224b842262756a07 (patch) | |
tree | bc3e2c91ca64fd5fd29312e33e6b215876892dbf /test/libsolidity | |
parent | 9709dfe04633ddb5e7d9911cdef1f4de54e5592e (diff) | |
download | dexon-solidity-f927da9182f6225d5ab354d4224b842262756a07.tar.gz dexon-solidity-f927da9182f6225d5ab354d4224b842262756a07.tar.zst dexon-solidity-f927da9182f6225d5ab354d4224b842262756a07.zip |
Refactor of bool TypeChecker::visit(FunctionCall const& _functionCall).
Visit method now cleanly determines if node represents a function call,
struct construction or type conversion. Type checking, validation and
error message logic is moved to separate methods.
Diffstat (limited to 'test/libsolidity')
3 files changed, 11 insertions, 1 deletions
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/102_duplicate_parameter_names_in_named_args.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/102_duplicate_parameter_names_in_named_args.sol index fab4beff..88402fa3 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/102_duplicate_parameter_names_in_named_args.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/102_duplicate_parameter_names_in_named_args.sol @@ -8,4 +8,4 @@ contract test { } // ---- // Warning: (31-37): This declaration shadows an existing declaration. -// TypeError: (159-160): Duplicate named argument. +// TypeError: (159-160): Duplicate named argument "a". diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/583_abi_encode_packed_with_rational_number_constant.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/583_abi_encode_packed_with_rational_number_constant.sol new file mode 100644 index 00000000..6be591f6 --- /dev/null +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/583_abi_encode_packed_with_rational_number_constant.sol @@ -0,0 +1,5 @@ +contract C { + function f() pure public { abi.encodePacked(0/1); } +} +// ---- +// TypeError: (61-64): Cannot perform packed encoding for a literal. Please convert it to an explicit type first.
\ No newline at end of file diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/584_abi_decode_with_tuple_of_other_than_types.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/584_abi_decode_with_tuple_of_other_than_types.sol new file mode 100644 index 00000000..c95eeb35 --- /dev/null +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/584_abi_decode_with_tuple_of_other_than_types.sol @@ -0,0 +1,5 @@ +contract C { + function f() pure public { abi.decode("", (0)); } +} +// ---- +// TypeError: (60-61): Argument has to be a type name. |