github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/compile/internal/types2/array.go (about)

     1  // Copyright 2011 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package types2
     6  
     7  // An Array represents an array type.
     8  type Array struct {
     9  	len  int64
    10  	elem Type
    11  }
    12  
    13  // NewArray returns a new array type for the given element type and length.
    14  // A negative length indicates an unknown length.
    15  func NewArray(elem Type, len int64) *Array
    16  
    17  // Len returns the length of array a.
    18  // A negative result indicates an unknown length.
    19  func (a *Array) Len() int64
    20  
    21  // Elem returns element type of array a.
    22  func (a *Array) Elem() Type
    23  
    24  func (a *Array) Underlying() Type
    25  func (a *Array) String() string