From ab67248bfa700abd950ea3578f84bcd5ca11d2c2 Mon Sep 17 00:00:00 2001 From: fireboltofdeath <24422634+Fireboltofdeath@users.noreply.github.com> Date: Sun, 15 May 2022 17:46:39 -0400 Subject: [PATCH] Remove symbols in union type guard generation --- src/util/functions/buildGuardFromType.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util/functions/buildGuardFromType.ts b/src/util/functions/buildGuardFromType.ts index 89bc6ff..ba6f279 100644 --- a/src/util/functions/buildGuardFromType.ts +++ b/src/util/functions/buildGuardFromType.ts @@ -286,6 +286,11 @@ function simplifyUnion(type: ts.UnionType) { const types = new Array(); 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;