subst

package
v1.19.0-beta2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2025 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package subst is an excerpt from x/tools/go/ssa responsible for performing type substitution in types defined in terms of type parameters with provided type arguments.

Copy of https://cs.opensource.google/go/x/tools/+/refs/tags/v0.33.0:go/ssa/subst.go Any changes to this copy are labelled with GOPHERJS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Subster

type Subster struct {
	// contains filtered or unexported fields
}

Subster performs type parameter substitution.

func New

func New(tc *types.Context, replacements map[*types.TypeParam]types.Type) *Subster

New creates a new Subster with a given a map from type parameters and the arguments that should be used to replace them. If the map is empty, nil is returned.

func (*Subster) Type

func (s *Subster) Type(typ types.Type) types.Type

Type returns a version of typ with all references to type parameters replaced with the corresponding type arguments.

func (*Subster) Types

func (s *Subster) Types(ts []types.Type) []types.Type

Types returns a version of ts with all references to type parameters replaced with the corresponding type arguments.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL