RedPRL / cooltt

😎TT
http://www.redprl.org/
Apache License 2.0
217 stars 16 forks source link

🩹 Bind field labels when pretty printing signatures #364

Closed mmcqd closed 2 years ago

mmcqd commented 2 years ago

This PR fixes a bug in Syntax.pp_sign, where field labels were not bound during pretty printing, leading to this code

def bad : type := sig (A : type) (a : A) (b : A)

def test (x : bad) : type :=
  let y := x in
  ?

causing this error

test.cooltt:5.2-5.3 [Info]:            
  Emitted hole:
    x : bad
    y : sub {sig (A : type) (a : x) 
        (y : cooltt: internal error, uncaught exception:
                     Failure("Pp printer: tried to resolve bound variable out of range")