fix(python): report circular inheritance again: a class may list itself once as its own ancestor

This commit is contained in:
l0ng-ai
2026-11-16 22:28:13 +08:00
parent ac3c564249
commit 635ec2d7bd
+2 -1
View File
@@ -302,7 +302,8 @@ export async function ancestryResolution(
cls: ClassInheritance,
depth = 8,
): Promise<AncestryResolution> {
const seen = new Set<string>([declarationKey(cls)]);
// `cls` itself is not pre-seen: a cycle lists it once as its own ancestor.
const seen = new Set<string>();
const out: AncestorNode[] = [];
let firstUnresolvedDepth = Infinity;
let level: ClassInheritance[] = [cls];