allocate immediately required fields

This commit is contained in:
2026-08-23 13:21:41 +02:00
parent 4bd1e24e75
commit 0c8e02ef03
6 changed files with 86 additions and 2 deletions
+17
View File
@@ -0,0 +1,17 @@
namespace RequiredTableDefaultTestNS;
table Inner {
value: uint32;
}
// `required_inner` has no default in the wire format (tables can't have one),
// but Pack()/Verify() both reject a buffer where it is missing - so the
// native default constructor must never leave it null. `optional_inner` is
// the same field type without `required`, kept alongside it to confirm the
// fix only changes required table fields, not every table pointer field.
table Holder {
required_inner: Inner (required);
optional_inner: Inner;
}
root_type Holder;