mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Allow global enum definitions.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
enum E { A }
|
||||
contract C {
|
||||
function f() public pure {
|
||||
E e = E.A;
|
||||
e;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
enum E { A }
|
||||
contract E {}
|
||||
// ----
|
||||
// DeclarationError: (13-26): Identifier already declared.
|
||||
@@ -0,0 +1,4 @@
|
||||
enum E { A }
|
||||
enum E { A }
|
||||
// ----
|
||||
// DeclarationError: (13-25): Identifier already declared.
|
||||
@@ -0,0 +1,10 @@
|
||||
enum E { A }
|
||||
contract C {
|
||||
enum E { A }
|
||||
function f() public pure {
|
||||
E e = E.A;
|
||||
e;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (30-42): This declaration shadows an existing declaration.
|
||||
@@ -0,0 +1,7 @@
|
||||
==== Source: a ====
|
||||
enum E { A }
|
||||
==== Source: b ====
|
||||
import "a";
|
||||
enum E { A }
|
||||
// ----
|
||||
// DeclarationError: (b:12-24): Identifier already declared.
|
||||
@@ -0,0 +1,7 @@
|
||||
==== Source: a ====
|
||||
enum E { A }
|
||||
==== Source: b ====
|
||||
import "a";
|
||||
contract E { }
|
||||
// ----
|
||||
// DeclarationError: (b:12-26): Identifier already declared.
|
||||
@@ -0,0 +1,7 @@
|
||||
==== Source: a ====
|
||||
enum E { A }
|
||||
==== Source: b ====
|
||||
import "a";
|
||||
struct E { uint256 a; }
|
||||
// ----
|
||||
// DeclarationError: (b:12-35): Identifier already declared.
|
||||
Reference in New Issue
Block a user