diff options
author | chriseth <chris@ethereum.org> | 2018-04-19 02:40:46 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-04-19 05:56:45 +0800 |
commit | a94945dfe40c879b6c3762620987a235582ccecf (patch) | |
tree | cd1308012cd19a0bded85f412291e34e7e1e4578 /test/libsolidity/syntaxTests/memberLookup | |
parent | 17beac1e07fba46f14d458ee600502c1da723f4f (diff) | |
download | dexon-solidity-a94945dfe40c879b6c3762620987a235582ccecf.tar dexon-solidity-a94945dfe40c879b6c3762620987a235582ccecf.tar.gz dexon-solidity-a94945dfe40c879b6c3762620987a235582ccecf.tar.bz2 dexon-solidity-a94945dfe40c879b6c3762620987a235582ccecf.tar.lz dexon-solidity-a94945dfe40c879b6c3762620987a235582ccecf.tar.xz dexon-solidity-a94945dfe40c879b6c3762620987a235582ccecf.tar.zst dexon-solidity-a94945dfe40c879b6c3762620987a235582ccecf.zip |
Improve error message for failed member lookup.
Diffstat (limited to 'test/libsolidity/syntaxTests/memberLookup')
3 files changed, 24 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/memberLookup/failed_function_lookup.sol b/test/libsolidity/syntaxTests/memberLookup/failed_function_lookup.sol new file mode 100644 index 00000000..c23992e9 --- /dev/null +++ b/test/libsolidity/syntaxTests/memberLookup/failed_function_lookup.sol @@ -0,0 +1,7 @@ +contract C { + function f(uint, uint) {} + function f(uint) {} + function g() { f(1, 2, 3); } +} +// ---- +// TypeError: (80-81): No matching declaration found after argument-dependent lookup. diff --git a/test/libsolidity/syntaxTests/memberLookup/failed_function_lookup_in_library.sol b/test/libsolidity/syntaxTests/memberLookup/failed_function_lookup_in_library.sol new file mode 100644 index 00000000..310c4a10 --- /dev/null +++ b/test/libsolidity/syntaxTests/memberLookup/failed_function_lookup_in_library.sol @@ -0,0 +1,9 @@ +library L { + function f(uint, uint) {} + function f(uint) {} +} +contract C { + function g() { L.f(1, 2, 3); } +} +// ---- +// TypeError: (94-97): Member "f" not found or not visible after argument-dependent lookup in type(library L) diff --git a/test/libsolidity/syntaxTests/memberLookup/push_on_memory_types.sol b/test/libsolidity/syntaxTests/memberLookup/push_on_memory_types.sol new file mode 100644 index 00000000..310c073f --- /dev/null +++ b/test/libsolidity/syntaxTests/memberLookup/push_on_memory_types.sol @@ -0,0 +1,8 @@ +contract Test { + function f() public pure { + uint[] memory x; + x.push(1); + } +} +// ---- +// TypeError: (77-83): Member "push" is not available in uint256[] memory outside of storage. |