The type of what a `For Each` over a value of type `t` binds: an array's or a .NET collection's element type.
(t: VbType)
| 65 | |
| 66 | /** The type of what a `For Each` over a value of type `t` binds: an array's or a .NET collection's element type. */ |
| 67 | function elementType(t: VbType): VbType | null { |
| 68 | if (t.array) return { ...t, array: false }; |
| 69 | return t.args?.length === 1 && VB_ELEMENT_COLLECTIONS.test(t.name) && t.args[0]!.name !== '?' ? t.args[0]! : null; |
| 70 | } |
| 71 | |
| 72 | /** VB.NET's built-in types, by keyword and by .NET name, keyed to the keyword. */ |
| 73 | const VB_BUILTIN_TYPES: ReadonlyMap<string, string> = new Map([ |