Skip to content

Commit

Permalink
Merge pull request #336 from capnproto/enhancement/promised-anystruct
Browse files Browse the repository at this point in the history
Add missing accessor for promised AnyStruct
  • Loading branch information
lthibault authored Nov 14, 2022
2 parents 072e16a + 0b8e0f8 commit 6f24fa5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion capnpc-go/any_pointer.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ type promiseAnyPointerRenderStrategy struct {
}

func (s promiseAnyPointerRenderStrategy) StructParams() any {
return s.PtrParams()
return promiseFieldAnyStructParams(s)
}

func (s promiseAnyPointerRenderStrategy) ListParams() any {
Expand Down
1 change: 1 addition & 0 deletions capnpc-go/templateparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ type promiseFieldParams struct {

type (
promiseFieldAnyPointerParams promiseFieldParams
promiseFieldAnyStructParams promiseFieldParams
promiseCapabilityFieldParams promiseFieldParams
promiseFieldAnyListParams promiseFieldParams
)
Expand Down
3 changes: 3 additions & 0 deletions capnpc-go/templates/promiseFieldAnyStruct
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
func (p {{ .Node.Name }}_Future) {{ .Field.Name|title }}() *capnp.Future {
return p.Future.Field({{ .Field.Slot.Offset }}, nil)
}

0 comments on commit 6f24fa5

Please sign in to comment.