compiler: optimize new empty struct creation with PACKSTRUCT
This commit is contained in:
parent
909ea477f4
commit
a8befeea33
2 changed files with 13 additions and 6 deletions
|
@ -394,6 +394,16 @@ var structTestCases = []testCase{
|
|||
}`,
|
||||
big.NewInt(11),
|
||||
},
|
||||
{
|
||||
"lengthy struct default value",
|
||||
`package foo
|
||||
type S struct { x int; y []byte; z bool }
|
||||
func Main() int {
|
||||
var s S
|
||||
return s.x
|
||||
}`,
|
||||
big.NewInt(0),
|
||||
},
|
||||
{
|
||||
"nested selectors (complex write)",
|
||||
`package foo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue