leanprover-community / quote4

Intuitive, type-safe expression quotations for Lean 4.
Apache License 2.0
73 stars 11 forks source link

`maximum recursion depth` error #13

Closed javra closed 1 year ago

javra commented 1 year ago

This causes an error

import Mathlib.Data.ZMod.Basic
open Qq

example (x : Q(ZMod <| 2^249)) : Q(Prop) := q($x = $x)
gebner commented 1 year ago

This is a bug in Lean itself. Qq-free MWE:

def ZMod : Nat → Type
  | 0 => Int
  | n+1 => Fin n

example (x : ZMod (2^300)) : Prop :=
  x = x -- maximum recursion depth has been reached
gebner commented 1 year ago

Also, I was positively surprised that I could debug this in GDB using rbreak throwMaxRecDepthAt.

javra commented 1 year ago

Oof, sorry, I'll post it there then. Seems like a unification problem then.