mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Ensures an empty use of var keyword is caught with the proper error message.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
(uint a, uint b, uint c);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError: (76-77): Expected '=' but got ';'
|
||||
@@ -0,0 +1,9 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
var ();
|
||||
var (,);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// SyntaxError: (52-58): The use of the "var" keyword is disallowed. The declaration part of the statement can be removed, since it is empty.
|
||||
// SyntaxError: (68-75): The use of the "var" keyword is disallowed. The declaration part of the statement can be removed, since it is empty.
|
||||
@@ -0,0 +1,8 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
var a;
|
||||
a.NeverReachedByParser();
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (52-57): Use of the "var" keyword is disallowed.
|
||||
@@ -0,0 +1,9 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
var (b, c);
|
||||
b.WeMustNotReachHere();
|
||||
c.FailsToLookupToo();
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (52-62): Use of the "var" keyword is disallowed.
|
||||
@@ -0,0 +1,7 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
var (d, e,);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (52-63): Use of the "var" keyword is disallowed.
|
||||
Reference in New Issue
Block a user