• Josh Bleecher Snyder's avatar
    cmd/compile: fix isStaticCompositeLiteral · 3c6e60c0
    Josh Bleecher Snyder authored
    Previously, isStaticCompositeLiteral would
    return the wrong value for literals like:
    
    [1]struct{ b []byte }{b: []byte{1}}
    
    Note that the outermost component is an array,
    but once we recurse into isStaticCompositeLiteral,
    we never check again that arrays are actually arrays.
    
    Instead of adding more logic to the guts of
    isStaticCompositeLiteral, allow it to accept
    any Node and return the correct answer.
    
    Change-Id: I6af7814a9037bbc7043da9a96137fbee067bbe0e
    Reviewed-on: https://go-review.googlesource.com/22247Reviewed-by: default avatarKeith Randall <khr@golang.org>
    3c6e60c0
sinit.go 29.3 KB