Skip to content

Commit

Permalink
C++: force include for types in vector and map (#2403)
Browse files Browse the repository at this point in the history
Related: #2402

Signed-off-by: black-desk <[email protected]>
Co-authored-by: David Siegel <[email protected]>
  • Loading branch information
black-desk and dvdsgl authored Mar 1, 2024
1 parent 916cd94 commit 0b5924d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/quicktype-core/src/language/CPlusPlus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ export class CPlusPlusRenderer extends ConvenienceRenderer {
const result: TypeRecord[] = [];
const recur = (forceInclude: boolean, isVariant: boolean, l: number, t: Type) => {
if (t instanceof ArrayType) {
recur(forceInclude, isVariant, l + 1, t.items);
recur(true, isVariant, l + 1, t.items);
} else if (t instanceof ClassType) {
result.push({
name: this.nameForNamedType(t),
Expand All @@ -1088,7 +1088,7 @@ export class CPlusPlusRenderer extends ConvenienceRenderer {
forceInclude
});
} else if (t instanceof MapType) {
recur(forceInclude, isVariant, l + 1, t.values);
recur(true, isVariant, l + 1, t.values);
} else if (t instanceof EnumType) {
result.push({
name: this.nameForNamedType(t),
Expand Down

0 comments on commit 0b5924d

Please sign in to comment.