Skip to content

Commit 26a66f7

Browse files
authored
Fix defining fields of forward-declared structures (#307)
This fixes a typo in the bindings generation script which set the `_fields` field rather than `_fields_`
1 parent 3b4086b commit 26a66f7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ci/cbindgen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def visit_Struct(self, node):
5353
decl.name = '_anon_' + str(anon_decl)
5454

5555
if node.name in self.forward_declared:
56-
self.ret += "{}._fields = [ # type: ignore\n".format(node.name)
56+
self.ret += "{}._fields_ = [\n".format(node.name)
5757
else:
5858
self.ret += "class {}(Structure):\n".format(node.name)
5959
self.ret += " _fields_ = [\n"

wasmtime/_bindings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3942,14 +3942,14 @@ class wasmtime_component_valunion(Union):
39423942

39433943
wasmtime_component_valunion_t = wasmtime_component_valunion
39443944

3945-
wasmtime_component_val._fields = [ # type: ignore
3945+
wasmtime_component_val._fields_ = [
39463946
("kind", wasmtime_component_valkind_t),
39473947
("of", wasmtime_component_valunion_t),
39483948
]
39493949

39503950
wasmtime_component_val_t = wasmtime_component_val
39513951

3952-
wasmtime_component_valrecord_entry._fields = [ # type: ignore
3952+
wasmtime_component_valrecord_entry._fields_ = [
39533953
("name", wasm_name_t),
39543954
("val", wasmtime_component_val_t),
39553955
]

0 commit comments

Comments
 (0)