| // Copyright 2019 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // Types useful for tests for the 2019 migration from |
| // unions to xunions. |
| |
| library fidl.test.unionmigration; |
| |
| type BasicXUnion = flexible union { |
| 1: i32 int32; |
| }; |
| |
| type BasicResourceXUnion = flexible resource union { |
| 1: i32 int32; |
| }; |
| |
| type BasicUnion = strict union { |
| 1: i32 int32; |
| }; |
| |
| type BasicXUnionStruct = struct { |
| val BasicXUnion; |
| }; |
| |
| type BasicResourceXUnionStruct = resource struct { |
| val BasicResourceXUnion; |
| }; |
| |
| type BasicUnionStruct = struct { |
| val BasicUnion; |
| }; |
| |
| type SingleVariantUnion = strict union { |
| 1: x uint32; |
| }; |
| |
| type SingleVariantUnionStruct = struct { |
| u SingleVariantUnion; |
| }; |
| |
| type SingleVariantUnionStructWithHeader = struct { |
| // Header exists to emulate the shape of the transaction header. |
| header array<uint8, 16>; |
| body SingleVariantUnionStruct; |
| }; |