MCPcopy Create free account
hub / github.com/decomp/decomp / dot

Method dot

cmd/go-post/typecheck.go:106–128  ·  view source on GitHub ↗

dot returns the type of "typ.name", making its decision using the type information in cfg.

(cfg *TypeConfig, name string)

Source from the content-addressed store, hash-verified

104// dot returns the type of "typ.name", making its decision
105// using the type information in cfg.
106func (typ *Type) dot(cfg *TypeConfig, name string) string {
107 if typ.Field != nil {
108 if t := typ.Field[name]; t != "" {
109 return t
110 }
111 }
112 if typ.Method != nil {
113 if t := typ.Method[name]; t != "" {
114 return t
115 }
116 }
117
118 for _, e := range typ.Embed {
119 etyp := cfg.Type[e]
120 if etyp != nil {
121 if t := etyp.dot(cfg, name); t != "" {
122 return t
123 }
124 }
125 }
126
127 return ""
128}
129
130// typecheck type checks the AST f assuming the information in cfg.
131// It returns two maps with type information:

Callers 1

typecheck1Function · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected