glutinum-org / cli

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

nested utility types cause parse error #140

Open joprice opened 4 weeks ago

joprice commented 4 weeks ago

I was attempting to parse framer-motion's type definitions and found a case where the parser fails. I narrowed it down to the use of Partial parameterized with another type like Omit:

Issue created from Glutinum Tool

Glutinum version - 0.11.0-preview

TypeScript

interface Y {}
type X = Partial<Omit<Y, "a">>

Error

The input sequence was empty.\nParameter name: source

Error: The input sequence was empty.\nParameter name: source
    at _wt (https://glutinum.net/assets/index-DpVFw9B_.js:12:4566)
    at l8t (https://glutinum.net/assets/index-DpVFw9B_.js:30528:21150)
    at f8t (https://glutinum.net/assets/index-DpVFw9B_.js:30528:22504)
    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)
    at Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadNode6C0FD055 (https://glutinum.net/assets/index-DpVFw9B_.js:30892:132132)
    at https://glutinum.net/assets/index-DpVFw9B_.js:30892:133973