diff --git a/src/compound/tagged_union.ts b/src/compound/tagged_union.ts index 085164c..76719d8 100644 --- a/src/compound/tagged_union.ts +++ b/src/compound/tagged_union.ts @@ -19,7 +19,7 @@ export class TaggedUnion< #variantFinder: Fn; #discriminant: AlignedType; - constructor(input: T, discriminantCodec: AlignedType, variantFinder: Fn) { + constructor(input: T, variantFinder: Fn, discriminantCodec: AlignedType = u8) { // Find biggest alignment const byteAlignment = Object.values(input) .reduce((acc, x) => Math.max(acc, x.byteAlignment), 0);