// matchExpr reports whether pattern x matches y. // // If tr.allowWildcards, Idents in x that refer to parameters are // treated as wildcards, and match any y that is assignable to the // parameter type; matchExpr records this correspondence in tr.env. // Otherwise, matchExpr simply reports whether the two trees are // equivalent. // // A wildcard appearing more than once in the pattern must // consistently match the same tree. func (tr *Transformer) matchExpr(x, y ast.Expr) bool { … } func (tr *Transformer) matchExprs(xx, yy []ast.Expr) bool { … } // matchType reports whether the two type ASTs denote identical types. func (tr *Transformer) matchType(x, y ast.Expr) bool { … } func (tr *Transformer) wildcardObj(x ast.Expr) (*types.Var, bool) { … } func (tr *Transformer) matchSelectorExpr(x, y *ast.SelectorExpr) bool { … } func (tr *Transformer) matchWildcard(xobj *types.Var, y ast.Expr) bool { … } func unparen(e ast.Expr) ast.Expr { … } // isRef returns the object referred to by this (possibly qualified) // identifier, or nil if the node is not a referring identifier. func isRef(n ast.Node, info *types.Info) types.Object { … }