Typescript
Branding and Type-Tagging
Branding and Type-Tagging
An example
An example
The above all completely valid in the IDA and compiler.
If you do the same thing but include the branding. As shown in the example above, using branding, the IDE and compiler will complain about the type being passed in.
Type Guards and Discriminated Unions
Type Guards and Discriminated Unions