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

     1  // Copyright 2022 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 syntax
     6  
     7  import "github.com/shogo82148/std/go/constant"
     8  
     9  // A Type represents a type of Go.
    10  // All types implement the Type interface.
    11  // (This type originally lived in types2. We moved it here
    12  // so we could depend on it from other packages without
    13  // introducing a circularity.)
    14  type Type interface {
    15  	Underlying() Type
    16  
    17  	String() string
    18  }
    19  
    20  // A TypeAndValue records the type information, constant
    21  // value if known, and various other flags associated with
    22  // an expression.
    23  // This type is similar to types2.TypeAndValue, but exposes
    24  // none of types2's internals.
    25  type TypeAndValue struct {
    26  	Type  Type
    27  	Value constant.Value
    28  	exprFlags
    29  }