Skip to content

Conversation

@kaankacar
Copy link

Added cov-mark coverage for type-checker error dedup

  • Add cov-mark as a workspace/test dependency.
  • Mark the first and duplicate branches in TypeChecker::push_error_dedup.
  • Extend the error-recovery test to assert the duplicate path is exercised with cov_mark::check!.

@kaankacar
Copy link
Author

Fixes #51

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds test coverage instrumentation using the cov-mark library to verify that the type-checker's error deduplication logic is properly exercised. The changes ensure both the "first occurrence" and "duplicate skipped" code paths are tested.

Changes:

  • Added cov-mark as a workspace dependency and included it in the type-checker and tests packages
  • Instrumented the error deduplication logic with coverage marks for both first occurrence and duplicate detection
  • Simplified the deduplication test case and added assertions to verify both code paths are exercised

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Cargo.toml Added cov-mark 2.2.0 as a workspace dependency
core/type-checker/Cargo.toml Added cov-mark dependency to type-checker package
core/type-checker/src/type_checker.rs Instrumented error deduplication branches with cov_mark::hit! calls
tests/Cargo.toml Added cov-mark dependency to tests package
tests/src/type_checker/error_recovery.rs Added cov_mark::check! assertions and simplified test case

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +134 to 135
cov_mark::check!(type_checker_error_dedup_skips_duplicate);
let result = try_type_check(source);
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cov_mark::check! call is placed before the code that should trigger the coverage mark. This will verify the mark was hit in a previous test run rather than during this specific test execution. Move the check after try_type_check(source) to properly verify the mark is hit during this test.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant