Merge pull request #4443 from ethereum/double_var_decl_fix

Fix crash when declaring the same var twice in the same scope
This commit is contained in:
chriseth
2018-07-12 00:05:32 +02:00
committed by GitHub
6 changed files with 49 additions and 1 deletions
@@ -0,0 +1,10 @@
contract test {
function f() pure public {
uint x;
{ uint x; }
uint x;
}
}
// ----
// Warning: (73-79): This declaration shadows an existing declaration.
// DeclarationError: (91-97): Identifier already declared.
@@ -0,0 +1,8 @@
contract test {
function f() pure public {
uint x;
uint x;
}
}
// ----
// DeclarationError: (71-77): Identifier already declared.
@@ -0,0 +1,16 @@
contract test {
function f() pure public {
uint x;
uint x;
uint x;
uint x;
uint x;
uint x;
}
}
// ----
// DeclarationError: (71-77): Identifier already declared.
// DeclarationError: (87-93): Identifier already declared.
// DeclarationError: (103-109): Identifier already declared.
// DeclarationError: (119-125): Identifier already declared.
// DeclarationError: (135-141): Identifier already declared.