| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library test.conformance; |
| |
| type UnionWithBoundString = strict union { |
| 1: boundFiveStr string:5; |
| }; |
| |
| type UnionWithBoundStringStruct = struct { |
| v UnionWithBoundString; |
| }; |
| |
| type SingleVariantUnion = strict union { |
| 1: x uint32; |
| }; |
| |
| type SingleVariantUnionStruct = struct { |
| u SingleVariantUnion; |
| }; |
| |
| type Uint8Union = strict union { |
| 1: uint8_value uint8; |
| 2: empty_struct EmptyStruct; |
| }; |
| |
| type Uint8UnionStruct = struct { |
| u Uint8Union; |
| }; |
| |
| // Union tags follow the explicit ordinal order, not source order. |
| type ReverseOrdinalUnion = strict union { |
| 4: x int64; // tag 2 |
| 3: reserved; |
| 2: y bool; // tag 1 |
| 1: z uint32; // tag 0 |
| }; |
| |
| type ReverseOrdinalUnionStruct = struct { |
| u ReverseOrdinalUnion; |
| }; |
| |
| @bindings_denylist("dart") |
| type RecursiveVectorUnion = strict union { |
| 1: vec vector<RecursiveVectorUnion:optional>; |
| }; |
| |
| @bindings_denylist("dart") |
| type RecursiveVectorUnionStruct = struct { |
| u RecursiveVectorUnion; |
| }; |
| |
| @bindings_denylist("dart") |
| type MutualRecursionUnion = strict union { |
| 1: s MutualRecursionUnionStruct; |
| }; |
| |
| @bindings_denylist("dart") |
| type MutualRecursionUnionStruct = struct { |
| u MutualRecursionUnion:optional; |
| }; |
| |
| type EnvelopeInliningTestUnion = flexible resource union { |
| 1: small uint32; |
| 2: large uint64; |
| 3: handle handle; |
| }; |
| |
| type EnvelopeInliningTestUnionStruct = resource struct { |
| u EnvelopeInliningTestUnion; |
| }; |