Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: on "type mismatch" errors, expose differences in functions and pi types #5922

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

kmill
Copy link
Collaborator

@kmill kmill commented Nov 1, 2024

Example: Normally subtype notation pretty prints as { x // x > 0 }, but now the difference in domains is exposed:

example (h : {x : Int // x > 0}) : {x : Nat // x > 0} := h
/-
error: type mismatch
  h
has type
  { x : Int // x > 0 } : Type
but is expected to have type
  { x : Nat // x > 0 } : Type
-/

…pi types

Example: Normally subtype notation pretty prints as `{ x // x > 0 }`, but now the difference in domains is exposed:
```
example : {x : Nat // x > 0} :=
  (sorry : {x : Int // x > 0})
/-
error: type mismatch
  sorry
has type
  { x : Int // x > 0 } : Type
but is expected to have type
  { x : Nat // x > 0 } : Type
-/
```
@kmill kmill enabled auto-merge November 1, 2024 18:21
@kmill kmill added this pull request to the merge queue Nov 1, 2024
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Nov 1, 2024
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase c7f5fd9a8351c0b69932a81d8d8010395f5e649b --onto 0973ba3e4260327f69587813d6a67e5fade0c977. (2024-11-01 18:45:40)

Merged via the queue into leanprover:master with commit 5549e05 Nov 1, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants