lean4-htt/tests/lean/run/1901.lean
Leonardo de Moura ffb0f42aae fix: fixes #1901
2022-12-01 08:39:06 -08:00

17 lines
596 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class Funny (F : Type _) (A B : outParam (Type _)) where
toFun : F → A → B
instance [Funny F A B] : CoeFun F fun _ => A → B where coe := Funny.toFun
class MulHomClass (F) (A B : outParam _) [Mul A] [Mul B] extends Funny F A B
class Monoid (M) extends Mul M
instance [Mul A] : Mul (Id A) := _
#check @Funny.toFun
#check @MulHomClass.toFunny
example {_ : Monoid A} {_ : Monoid B} [MulHomClass F A B] : Funny F A B :=
inferInstance
-- set_option trace.Meta.synthInstance true
example [Monoid A] [Monoid B] [MulHomClass F A B] (f : F) (a : A) : f a = f a := rfl -- infinite loop