glutinum-org / cli

https://glutinum.net/
59 stars 6 forks source link

Exclude utility does not handle case of single case output type #141

Open joprice opened 3 weeks ago

joprice commented 3 weeks ago

Issue created from Glutinum Tool

Glutinum version - 0.11.0-preview

TypeScript

type UnionResult = Exclude<"a" | "b" | "c", "a">
type PrimitiveResult = Exclude<"a" | "b", "a">;

Error

undefined is not iterable (cannot read property Symbol(Symbol.iterator))

TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at sA (https://glutinum.net/assets/index-DpVFw9B_.js:9:7849)
    at X1e (https://glutinum.net/assets/index-DpVFw9B_.js:11:17206)
    at Od (https://glutinum.net/assets/index-DpVFw9B_.js:12:2990)
    at c8t (https://glutinum.net/assets/index-DpVFw9B_.js:30528:20859)
    at f8t (https://glutinum.net/assets/index-DpVFw9B_.js:30528:22474)
    at Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNodeZ64B23DD2 (https://glutinum.net/assets/index-DpVFw9B_.js:30892:132575)
    at Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD (https://glutinum.net/assets/index-DpVFw9B_.js:30892:132441)
    at o8t (https://glutinum.net/assets/index-DpVFw9B_.js:30528:16557)
    at Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeAliasDeclarationZ7FA16745 (https://glutinum.net/assets/index-DpVFw9B_.js:30892:132267)
    at i8t (https://glutinum.net/assets/index-DpVFw9B_.js:30528:15373)

Problem description

When Exclude is provided with a set of members that result in only a single type remaining in the output type, glutinum fails to parse the file.