blob: 441cb3c0ef83c4f7d9eeca8d4408da5c6d030360 [file] [log] [blame]
// 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
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;
};
type EmptyFlexibleUnion = flexible union {};
type StructOfEmptyFlexibleUnion = struct {
empty EmptyFlexibleUnion;
};