aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorChristian Parpart <christian@parpart.family>2018-10-05 21:38:14 +0800
committerChristian Parpart <christian@ethereum.org>2018-10-15 16:35:11 +0800
commit6d815a142fbf85e19ab4f061c6e4275a26ff2e5f (patch)
treee8ccd335af9f64d139304d23bb3dc8df50577cfa /test/libsolidity
parent26dc876c28718613ad64961e65374ace1139010b (diff)
downloaddexon-solidity-6d815a142fbf85e19ab4f061c6e4275a26ff2e5f.tar.gz
dexon-solidity-6d815a142fbf85e19ab4f061c6e4275a26ff2e5f.tar.zst
dexon-solidity-6d815a142fbf85e19ab4f061c6e4275a26ff2e5f.zip
Fixes invalid function calls to literals inside tuple assignment's LHS.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/syntaxTests/types/function_call_fail.sol9
-rw-r--r--test/libsolidity/syntaxTests/types/function_call_fail2.sol7
2 files changed, 16 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/types/function_call_fail.sol b/test/libsolidity/syntaxTests/types/function_call_fail.sol
new file mode 100644
index 00000000..ef52ab44
--- /dev/null
+++ b/test/libsolidity/syntaxTests/types/function_call_fail.sol
@@ -0,0 +1,9 @@
+contract C {
+ function f(uint y) public pure {
+ (4(y)) = 2;
+ }
+}
+// ----
+// TypeError: (59-63): Type is not callable
+// TypeError: (59-63): Expression has to be an lvalue.
+// TypeError: (67-68): Type int_const 2 is not implicitly convertible to expected type tuple().
diff --git a/test/libsolidity/syntaxTests/types/function_call_fail2.sol b/test/libsolidity/syntaxTests/types/function_call_fail2.sol
new file mode 100644
index 00000000..389ffce9
--- /dev/null
+++ b/test/libsolidity/syntaxTests/types/function_call_fail2.sol
@@ -0,0 +1,7 @@
+contract C {
+ function f(uint y) public pure returns (uint) {
+ (f(y)) = 2;
+ }
+}
+// ----
+// TypeError: (74-78): Expression has to be an lvalue.