MCPcopy
hub / github.com/gopherjs/gopherjs / fieldType

Method fieldType

compiler/utils.go:622–624  ·  view source on GitHub ↗

fieldType returns the type of the i-th field of the given struct after substituting type parameters with concrete types for nested context.

(t *types.Struct, i int)

Source from the content-addressed store, hash-verified

620// fieldType returns the type of the i-th field of the given struct
621// after substituting type parameters with concrete types for nested context.
622func (fc *funcContext) fieldType(t *types.Struct, i int) types.Type {
623 return fc.typeResolver.Substitute(t.Field(i).Type())
624}
625
626func (fc *funcContext) selectionOf(e *ast.SelectorExpr) (typesutil.Selection, bool) {
627 if sel, ok := fc.pkgCtx.Selections[e]; ok {

Callers 6

initArgsMethod · 0.95
translateSelectionMethod · 0.95
translateExprMethod · 0.95
makeReceiverMethod · 0.95
loadStructMethod · 0.95
structConstructorMethod · 0.95

Calls 3

SubstituteMethod · 0.80
TypeMethod · 0.65
FieldMethod · 0.45

Tested by

no test coverage detected