• Matthew Dempsky's avatar
    cmd/compile: extract typecheckarraylit function · f672e221
    Matthew Dempsky authored
    Typechecking slice literals, array literals, and array literals using
    "..." notation all use very similar logic, but tie into the logic for
    checking the OCOMPLIT node in slightly different ways.
    
    By refactoring this function out into a separate helper, it makes it
    easier to separate slice and array literals, and the subsequent CL
    will further separate array literals that do use "..." notation from
    those that do not.
    
    Passes toolstash-check.
    
    Change-Id: I4c572e0d9d08bcc86b5c224bd6f9e1c498726c19
    Reviewed-on: https://go-review.googlesource.com/c/go/+/197603
    Run-TryBot: Matthew Dempsky <mdempsky@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
    f672e221
typecheck.go 86.2 KB