| library test.nullable; |
| |
| using zx; |
| |
| type StructWithNullableString = struct { |
| val string:optional; |
| }; |
| |
| type StructWithNullableVector = struct { |
| val vector<int32>:optional; |
| }; |
| |
| type StructWithNullableHandle = resource struct { |
| val zx.Handle:<VMO, optional>; |
| }; |
| |
| closed protocol SimpleProtocol { |
| strict Add(struct { |
| a int32; |
| b int32; |
| }) -> (struct { |
| sum int32; |
| }); |
| }; |
| |
| type StructWithNullableProtocol = resource struct { |
| val client_end:<SimpleProtocol, optional>; |
| }; |
| |
| type StructWithNullableRequest = resource struct { |
| val server_end:<SimpleProtocol, optional>; |
| }; |
| |
| type Int32Wrapper = struct { |
| val int32; |
| }; |
| |
| type StructWithNullableStruct = struct { |
| val box<Int32Wrapper>; |
| }; |
| |
| type SimpleUnion = strict union { |
| 1: a int32; |
| 2: b float32; |
| }; |
| |
| type StructWithNullableUnion = struct { |
| val SimpleUnion:optional; |
| }; |