mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Move direct struct recursion check to detect recursion in global structs.
This commit is contained in:
+1
-1
@@ -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.
|
||||
Reference in New Issue
Block a user