Skip to content

Commit

Permalink
fix(neverAccessedVariables): Remove incorrect logger msg
Browse files Browse the repository at this point in the history
Actually, a contract/trait can have multiple parent traits, e.g.
inheriting `Resumable` and `Ownable` lead to this behavior.
  • Loading branch information
jubnzv committed Nov 26, 2024
1 parent 6fb3bee commit b106ae0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/detectors/builtin/neverAccessedVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b106ae0

Please sign in to comment.