Zulip Chat Archive

Stream: general

Topic: bug with $ in equation compiler


Kenny Lau (Feb 17 2019 at 10:08):

@[simp] def B :    := λ x, 0
def A :   
| 0 := 0
| (x+1) := x + A $ B 0
type mismatch at application
  x + A
term
  A
has type
  ℕ → ℕ
but is expected to have type
  ℕ
Additional information:
c:\XXX.lean:4:17: context: switched to simple application elaboration procedure because failed to use expected type to elaborate it, error message
  too many arguments

Mario Carneiro (Feb 17 2019 at 10:11):

Since $ has ridiculously low precedence, this is interpreted as (x + A) (B 0)


Last updated: Dec 20 2023 at 11:08 UTC