Zulip Chat Archive

Stream: lean4

Topic: Noncomputable Coe.coe ?


Arthur Adjedj (Jul 20 2023 at 20:28):

Hi, the following code gives a rather unexpected error:

instance [h : Coe α (Sort u)] : CoeSort α (Sort u) where
  coe := h.coe
/-failed to compile definition,
  consider marking it as 'noncomputable'
  because it depends on 'Coe.coe', and it
  does not have executable code-/

Even though this works fine:

instance [h : Coe α (Sort u)] : CoeSort α (Sort u) where
  coe x := h.coe x

I'm assuming this is a bug ?

Gabriel Ebner (Jul 20 2023 at 21:05):

Looks similar to https://github.com/leanprover/lean4/issues/2104

Arthur Adjedj (Jul 20 2023 at 21:47):

Indeed ! Should I add this MWE to the issue as well, or would it be best left as-is ?

Scott Morrison (Jul 20 2023 at 23:27):

I think it's good to add it.


Last updated: Dec 20 2023 at 11:08 UTC