Move direct struct recursion check to detect recursion in global structs.

This commit is contained in:
Daniel Kirchner
2020-04-16 16:42:12 +02:00
parent b744a56801
commit 6f06154eb5
7 changed files with 54 additions and 37 deletions
@@ -4,7 +4,7 @@ contract C {
function f(Data.S memory a) public {}
}
contract Data {
struct S { S x; }
struct S { S[] x; }
}
// ----
// TypeError: (63-78): Recursive type not allowed for public or external contract functions.
@@ -0,0 +1,7 @@
contract C {
struct S {
var x;
}
}
// ----
// ParserError: (27-30): Expected explicit type name.
@@ -0,0 +1,8 @@
struct s1 { s2 x; }
struct s2 { s1 y; }
contract C {
// whatever
}
// ----
// TypeError: (0-19): Recursive struct definition.