leanprover-community / lean4-metaprogramming-book

https://leanprover-community.github.io/lean4-metaprogramming-book/
Apache License 2.0
211 stars 50 forks source link

Introduction chapter: Getting an error on assertTypeCmd in Lean4 #75

Closed lakesare closed 1 year ago

lakesare commented 1 year ago

I'm getting the following error in the Introduction#Building a command example.
My Lean version is "leanprover/lean4:nightly-2022-10-09". Does this look familiar?

image
arthurpaulino commented 1 year ago

Oh, the API must have changed. What happens if you don't pass the `assertTypeCmd argument?

lakesare commented 1 year ago

It goes like this:

image
arthurpaulino commented 1 year ago

@lakesare I've bumped the toolchain and fixed that issue: https://github.com/arthurpaulino/lean4-metaprogramming-book/commit/ec355bba83e3d65db57952f13abc23a32cafd009

Make sure to check the indentation levels of your code because the try ... needs to be deeper than liftTermElabM

lakesare commented 1 year ago

That worked! Thanks for the note about the nesting level, that was also important.