Skip to content

Commit

Permalink
Remove symbols in union type guard generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Fireboltofdeath committed May 15, 2022
1 parent b0f4ec7 commit ab67248
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/util/functions/buildGuardFromType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@ function simplifyUnion(type: ts.UnionType) {
const types = new Array<ts.Type>();

for (const type of currentTypes) {
// We do not need to generate symbol types as they don't exist in Lua.
if (type.flags & ts.TypeFlags.ESSymbolLike) {
continue;
}

if (!type.symbol || !type.symbol.parent) {
types.push(type);
continue;
Expand Down

0 comments on commit ab67248

Please sign in to comment.