wilbowma/cur

cur-type-check? not behaving as expected

Closed this issue · 3 comments

#lang cur

(begin-for-syntax 
  (require rackunit) 
  (check-true 
    (cur-type-check? 
      #`(lambda (A : Type) (a : A) a) 
      #`(Π (A : Type) (a : A) A))))

Note:

> (begin-for-syntax (displayln (cur-type-infer #`(lambda (A : Type) (a : A) a))))

#<syntax:reflection.rkt:191:7 (cur-Π (A : (cur-Type 0)) (cur-Π (a : A) A))>

cur-type-check basically calls infer then type-check? in turnstile.

It looks like cur-type-check? is not normalizing the expected type. It needs to call current-type-eval on the type there. (Looks like there used to be a call to cur-expand, but it got commented out at some point?)

Btw, in general I dont know how reliable curnel/reflection is. I didn't update it when I reimplemented the core, and I've actually been operating under the assumption that it's deprecated (I've been using turnstile libraries directly in my code).

I'm fine with bringing reflection back up to speed, but just be aware that it likely requires some more fixes (and tests!).

Ah I see. Keep filing issues and I'll try to respond quickly.