(kinds: ReadonlySet<string>)
| 1026 | function classThroughAliases(simple: string, fromFile: string, context: ResolutionContext, seen: Set<string>): Node | null { |
| 1027 | const named = pascalNamed(simple, context); |
| 1028 | const visible = (kinds: ReadonlySet<string>): Node[] => { |
| 1029 | // In the unit's own files, then in the unit used last, which declares the |
| 1030 | // name Delphi sees; else in the one unit that does. |
| 1031 | const candidates = named.filter((n) => kinds.has(n.kind)); |
| 1032 | for (const file of ownUnitFiles(fromFile, context)) { |
| 1033 | const own = candidates.filter((n) => n.filePath === file); |
| 1034 | if (own.length > 0) return own; |
| 1035 | } |
| 1036 | const used = usedUnitFiles(fromFile, context); |
| 1037 | for (let i = used.length - 1; i >= 0; i--) { |
| 1038 | const there = candidates.filter((n) => n.filePath === used[i]); |
| 1039 | if (there.length > 0) return there; |
| 1040 | } |
| 1041 | return candidates.length > 0 && candidates.every((n) => n.filePath === candidates[0]!.filePath) ? candidates : []; |
| 1042 | }; |
| 1043 | const cls = declarationOf(visible(CLASS_KINDS)); |
| 1044 | if (cls) return cls; |
| 1045 | // A type alias names the class it stands for: `TVTAncestor = TVTAncestorVcl;`, |
no test coverage detected