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