diff --git a/list.go b/list.go index 0f6af2b9..3099f5f8 100644 --- a/list.go +++ b/list.go @@ -1081,10 +1081,10 @@ func (s StructList[T]) Set(i int, v T) error { // A list of some Cap'n Proto capability type T. type CapList[T ~ClientKind] PointerList -func (c CapList[T]) At(i int) (T, error) { +func (c CapList[T]) At(i int) (res T, err error) { ptr, err := PointerList(c).At(i) if err != nil { - return T{}, err + return res, err } return T(ptr.Interface().Client()), nil }