blob: 4f06572be71afbf40c8c6a90fcc9f47663672886 [file] [log] [blame]
// Copyright 2021 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 RecursiveOptionalBasicStruct = struct {
inner box<RecursiveOptionalBasicStruct>;
};
type RecursiveVectorStruct = struct {
vec vector<RecursiveVectorStruct>:optional;
};
type RecursiveUnionStruct = struct {
u RecursiveUnion:optional;
};
type RecursiveUnion = union {
// The union type can't be directly depended on because it causes an include cycle.
1: s RecursiveUnionStruct;
};
type RecursiveTableHolder = struct {
// A table can't be optional so it needs to be wrapped in an optional struct.
t RecursiveTable;
};
type RecursiveTableOptionalHolder = struct {
o box<RecursiveTableHolder>;
};
type RecursiveTable = table {
// A table field can't be optional. Including the table in a non-optional way causes an include cycle.
1: s RecursiveTableOptionalHolder;
};