From 713c9ddd6f0b392294ec2b90fafa7536d6bd2151 Mon Sep 17 00:00:00 2001 From: Ian Denhardt Date: Sat, 30 Jul 2022 21:20:33 -0400 Subject: [PATCH] Remove a couple uses of the *_List type aliases. This is in preparation for removing the aliases entirely. Most importantly, this patch removes the one use inside the code generator itself. We can't actually delete the aliases until the code generator no longer uses them at call sites, but this is the first step. --- capnpc-go/nodes.go | 3 ++- integration_test.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/capnpc-go/nodes.go b/capnpc-go/nodes.go index d042bb0c..e68c4b8a 100644 --- a/capnpc-go/nodes.go +++ b/capnpc-go/nodes.go @@ -5,6 +5,7 @@ import ( "fmt" "strings" + "capnproto.org/go/capnp/v3" "capnproto.org/go/capnp/v3/internal/schema" ) @@ -156,7 +157,7 @@ type annotations struct { Name string } -func parseAnnotations(list schema.Annotation_List) *annotations { +func parseAnnotations(list capnp.StructList[schema.Annotation]) *annotations { ann := new(annotations) for i, n := 0, list.Len(); i < n; i++ { a := list.At(i) diff --git a/integration_test.go b/integration_test.go index aff9f3c4..386a59a2 100644 --- a/integration_test.go +++ b/integration_test.go @@ -1040,7 +1040,7 @@ func TestReadNestedListOfStructWithList(t *testing.T) { t.Errorf("RWTestCapn.nestMatrix[%d]: %v", i, err) return } - rowList := air.Nester1Capn_List{List: row.List()} + rowList := capnp.StructList[air.Nester1Capn]{List: row.List()} if j >= rowList.Len() { t.Errorf("len(RWTestCapn.nestMatrix[%d]) = %d; tried to index %d", i, rowList.Len(), j) return