func (r *implementsResult) toSerial(res *serial.Result, fset *token.FileSet) {
	res.Implements = &serial.Implements{
		T:                 makeImplementsType(r.t, fset),
		AssignableTo:      makeImplementsTypes(r.to, fset),
		AssignableFrom:    makeImplementsTypes(r.from, fset),
		AssignableFromPtr: makeImplementsTypes(r.fromPtr, fset),
	}
}
Esempio n. 2
0
func (r *implementsResult) toSerial(res *serial.Result, fset *token.FileSet) {
	var facts []*serial.Implements
	for _, fact := range r.facts {
		facts = append(facts, &serial.Implements{
			I:    fact.iface.String(),
			IPos: fset.Position(fact.iface.Obj().Pos()).String(),
			C:    fact.conc.String(),
			CPos: fset.Position(deref(fact.conc).(*types.Named).Obj().Pos()).String(),
		})
	}
	res.Implements = facts
}