MCPcopy
hub / github.com/gopherjs/gopherjs / Substitute

Method Substitute

compiler/internal/typeparams/resolver.go:149–154  ·  view source on GitHub ↗

Substitute replaces references to type params in the provided type definition with the corresponding concrete types.

(typ types.Type)

Source from the content-addressed store, hash-verified

147// Substitute replaces references to type params in the provided type definition
148// with the corresponding concrete types.
149func (r *Resolver) Substitute(typ types.Type) types.Type {
150 if r == nil || typ == nil {
151 return typ // No substitutions to be made.
152 }
153 return r.subster.Type(typ)
154}
155
156// SubstituteAll same as Substitute, but accepts a TypeList are returns
157// substitution results as a slice in the same order.

Callers 11

SubstituteAllMethod · 0.95
SubstituteSelectionMethod · 0.95
translateStmtMethod · 0.80
translateResultsMethod · 0.80
initArgsMethod · 0.80
typeNameMethod · 0.80
typeOfMethod · 0.80
fieldTypeMethod · 0.80
translateFunctionBodyMethod · 0.80
newNamedTypeInstDeclMethod · 0.80
ResolveMethod · 0.80

Calls 1

TypeMethod · 0.65

Tested by

no test coverage detected