Add more syntax tests for enums and interfaces/libraries

This commit is contained in:
Alex Beregszaszi 2018-08-07 13:35:23 +01:00
parent 13e37df97c
commit ce29aac8ad
5 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,9 @@
interface I {
enum Direction { Left, Right }
}
contract D {
function f() public pure returns (I.Direction) {
return I.Direction.Left;
}
}

View File

@ -0,0 +1,12 @@
interface I {
enum Direction { Left, Right }
}
library L {
function f() public pure returns (I.Direction) {
return I.Direction.Left;
}
function g() internal pure returns (I.Direction) {
return I.Direction.Left;
}
}

View File

@ -0,0 +1,9 @@
library L {
enum Direction { Left, Right }
}
contract D {
function f() public pure returns (L.Direction) {
return L.Direction.Left;
}
}

View File

@ -0,0 +1,9 @@
contract C {
enum Direction { Left, Right }
}
contract D is C {
function f() public pure returns (Direction) {
return Direction.Left;
}
}

View File

@ -0,0 +1,9 @@
interface I {
enum Direction { Left, Right }
}
contract D is I {
function f() public pure returns (Direction) {
return Direction.Left;
}
}