Skip to content

[checking] elide_missing_patterns does not account for Partial via superclass entailment #147

Description

@coderabbitai

Summary

In compiler-core/checking/src/core/constraint.rs, the elide_missing_patterns check (introduced in #146) uses implication_given.contains(partial) to decide whether to suppress MissingPatterns errors. This only inspects the raw/direct given set and does not account for Partial being made available through superclass entailment.

As a result, if Partial is reachable via a superclass but not listed as a direct given, MissingPatterns errors may still be emitted even though the scope should permit partiality.

Details

  • File: compiler-core/checking/src/core/constraint.rs
  • Relevant lines: around the elide_missing_patterns computation in collect_scoped_constraints

The fix would be to consult the elaborated/entailment-aware given set when computing elide_missing_patterns, so that Partial derived through superclass entailment also suppresses the error.

Context

Raised as a review comment on #146: #146 (comment)

Acknowledged as a known limitation by @purefunctorPartial is typically provided directly in practice, making this a very small class of bug unlikely to appear in real-world codebases. Tracked here for completeness.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

checkingRelated to the type checkersemanticsSemantics to be refined

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions