You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The anonymous constructor notation ⟨...⟩ fails to pass parameters to the constructor when the constructor requires that parameters be passed explicitly.
Steps to Reproduce
inductivePointed : Type → Type
| mk α : α → Pointed α
example : Pointed Bool := ⟨false⟩
example : Pointed (String × Nat) := ⟨"", 0⟩
Expected behavior: The code should succeed with no errors, as it does when α is an implicit parameter to mk.
Actual behavior: The code results in the following errors:
application type mismatch
Pointed.mk false
argument
false
has type
Bool : Type
but is expected to have type
Type : Type 1
invalid constructor ⟨...⟩, expected type must be an inductive type
Type
Versions
Lean 4.16.0-nightly-2025-01-06
Appears in Lean 4.0.0-m5, though I did not check before this.
The current implementation and error messages mention explicit fields rather than parameters, but it would be fine either way. I would expect one of ⟨⟩ and ⟨_⟩ to work in place of rfl.
Kha
changed the title
anonymous ctor notation fails on constructors with explicit params
anonymous ctor notation fails on constructors of type families with explicit params
Jan 10, 2025
Prerequisites
Please put an X between the brackets as you perform the following steps:
https://github.com/leanprover/lean4/issues
Avoid dependencies to Mathlib or Batteries.
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
The anonymous constructor notation
⟨...⟩
fails to pass parameters to the constructor when the constructor requires that parameters be passed explicitly.Steps to Reproduce
Expected behavior: The code should succeed with no errors, as it does when
α
is an implicit parameter tomk
.Actual behavior: The code results in the following errors:
Versions
Lean 4.16.0-nightly-2025-01-06
Appears in Lean 4.0.0-m5, though I did not check before this.
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: