-
Notifications
You must be signed in to change notification settings - Fork 810
CoeFun causes types to be unfolded #1891
Copy link
Copy link
Closed
Labels
Mathlib4 high prioMathlib4 high priority issueMathlib4 high priority issue
Description
class FunLike (F : Sort _) (β : outParam <| Nat → Sort _) where
coe : F → ∀ a, β a
inductive Secret
def Wrapper := Secret
inductive Bla | z
instance : FunLike Bla (fun _ => Wrapper) := sorry
instance (priority := 100) {F β} [FunLike F β] :
CoeFun F fun _ => ∀ a : Nat, β a where coe := FunLike.coe
#check Bla.z 0 -- FunLike.coe Bla.z 0 : (fun x => Wrapper) 0
#check Bla.z ∘ id -- FunLike.coe Bla.z ∘ id : Nat → SecretThis shows two different but possibly related issues:
- The first
#checkresults in a term whose type is a beta redex. Most likely there is a missingheadBeta. - The second
#checkis the real issue: even though↑Bla.z : Nat → Wrapperand there are no hard unification problems in the way, the inferred type of↑Bla.z ∘ idisNat → Secret, which can cause a failure later ifSecretandWrapperhave different typeclasses on them.
Reported by @semorrison on Zulip.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Mathlib4 high prioMathlib4 high priority issueMathlib4 high priority issue