mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 23:02:27 +00:00
compiler: support nested struct reading
This commit is contained in:
parent
c751472852
commit
1e40f9dac0
2 changed files with 20 additions and 9 deletions
|
@ -338,6 +338,20 @@ var structTestCases = []testCase{
|
|||
}`,
|
||||
big.NewInt(2),
|
||||
},
|
||||
{
|
||||
"nested selectors (simple read)",
|
||||
`package foo
|
||||
type S1 struct { x, y S2 }
|
||||
type S2 struct { a, b int }
|
||||
func Main() int {
|
||||
var s1 S1
|
||||
var s2 S2
|
||||
s2.a = 3
|
||||
s1.y = s2
|
||||
return s1.y.a
|
||||
}`,
|
||||
big.NewInt(3),
|
||||
},
|
||||
}
|
||||
|
||||
func TestStructs(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue