diff --git a/src/detectors/builtin/neverAccessedVariables.ts b/src/detectors/builtin/neverAccessedVariables.ts index 37e07a79..5afcb167 100644 --- a/src/detectors/builtin/neverAccessedVariables.ts +++ b/src/detectors/builtin/neverAccessedVariables.ts @@ -241,11 +241,7 @@ export class NeverAccessedVariables extends DataflowDetector { ctx.logger.error(`Cannot access trait ${traitName}`); return; } - if (visited.has(trait.id)) { - // Impossible case. Added to handle further regressions. - ctx.logger.error(`Trait #${trait.id} has inheritance cycle`); - return; - } + if (visited.has(trait.id)) return; visited.add(trait.id); callback(trait); this.forEachTrait(ctx, cu, trait.traits, callback, visited);