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
Reduced the issue to a self-contained, reproducible test case.
Description
The following code fails; even with pp.all true, the error message isn't terribly helpful since it doesn't do anything with the literal 1 :
set_option pp.all true
structure Title where
val : String
instance : OfNat Title 1 where
ofNat := ⟨""⟩
-- failed to synthesize instance OfNat.{0} Title 1
example : Title := 1
Looking at the lean4 repo, the workaround seems to be instance : OfNat Title (nat_lit 1) := ..., which does work, but this seems like something that would frustrate new users.
Prerequisites
Description
The following code fails; even with
pp.all true
, the error message isn't terribly helpful since it doesn't do anything with the literal1
:Looking at the lean4 repo, the workaround seems to be
instance : OfNat Title (nat_lit 1) := ...
, which does work, but this seems like something that would frustrate new users.Versions
Lean (version 4.0.0-nightly-2021-12-13, commit 3a6cc77, Release)
MacOS 11.4
The text was updated successfully, but these errors were encountered: