aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChristian Parpart <christian@parpart.family>2018-07-11 22:33:09 +0800
committerGitHub <noreply@github.com>2018-07-11 22:33:09 +0800
commit08345209e6f68c509ec5af820596a2172b886568 (patch)
tree871e6013da5ab0870b4838bc8f31c369062f6722 /test
parentf3abfa81ad3cdf3cfd0b9e1acf11329a617466a2 (diff)
parent458a4c8aa5dc88aed46ad1ab1494fa035af09e31 (diff)
downloaddexon-solidity-08345209e6f68c509ec5af820596a2172b886568.tar
dexon-solidity-08345209e6f68c509ec5af820596a2172b886568.tar.gz
dexon-solidity-08345209e6f68c509ec5af820596a2172b886568.tar.bz2
dexon-solidity-08345209e6f68c509ec5af820596a2172b886568.tar.lz
dexon-solidity-08345209e6f68c509ec5af820596a2172b886568.tar.xz
dexon-solidity-08345209e6f68c509ec5af820596a2172b886568.tar.zst
dexon-solidity-08345209e6f68c509ec5af820596a2172b886568.zip
Merge pull request #4404 from ethereum/v050-var-keyword-suggest
[WIP] v0.5.0 var keyword type suggestion
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/syntaxTests/types/var_type_suggest.sol23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/types/var_type_suggest.sol b/test/libsolidity/syntaxTests/types/var_type_suggest.sol
new file mode 100644
index 00000000..176fab96
--- /dev/null
+++ b/test/libsolidity/syntaxTests/types/var_type_suggest.sol
@@ -0,0 +1,23 @@
+contract C {
+ function h() internal pure returns (uint, uint, uint) {
+ return (1, 2, 4);
+ }
+ function g(uint x) internal pure returns (uint) {
+ return x;
+ }
+ function f() internal pure {
+ var i = 31415;
+ var t = "string";
+ var g2 = g;
+ var myblockhash = block.blockhash;
+ var (a, b) = (2, "troi");
+ var (x,, z) = h();
+ }
+}
+// ----
+// SyntaxError: (224-237): Use of the "var" keyword is disallowed. Use explicit declaration `uint16 i = ...´ instead.
+// SyntaxError: (247-263): Use of the "var" keyword is disallowed. Use explicit declaration `string memory t = ...´ instead.
+// SyntaxError: (273-283): Use of the "var" keyword is disallowed. Use explicit declaration `function (uint256) pure returns (uint256) g2 = ...´ instead.
+// SyntaxError: (293-326): Use of the "var" keyword is disallowed. Type cannot be expressed in syntax.
+// SyntaxError: (336-360): Use of the "var" keyword is disallowed. Use explicit declaration `(uint8 a, string memory b) = ...´ instead.
+// SyntaxError: (370-387): Use of the "var" keyword is disallowed. Use explicit declaration `(uint256 x, , uint256 z) = ...´ instead.