Fix inner-expand bug, changed type error output
* Fix inner-expand? issue which could prevent type-checking terms properly. * No longer print out gamma and sigma when type checking fails
This commit is contained in:
parent
ca9e36a973
commit
4cae9688fb
|
@ -153,7 +153,7 @@
|
||||||
(define reified-term
|
(define reified-term
|
||||||
;; TODO: This results in less good error messages. Add an
|
;; TODO: This results in less good error messages. Add an
|
||||||
;; algorithm to find the smallest ill-typed term.
|
;; algorithm to find the smallest ill-typed term.
|
||||||
(parameterize ([inner-expand? #f])
|
(parameterize ([inner-expand? #t])
|
||||||
(let cur->datum ([syn syn])
|
(let cur->datum ([syn syn])
|
||||||
(syntax-parse (core-expand syn)
|
(syntax-parse (core-expand syn)
|
||||||
#:literals (term reduce #%app subst-all)
|
#:literals (term reduce #%app subst-all)
|
||||||
|
@ -178,12 +178,9 @@
|
||||||
(term (elim ,t1 ,t2)))]
|
(term (elim ,t1 ,t2)))]
|
||||||
[(#%app e1 e2)
|
[(#%app e1 e2)
|
||||||
(term (,(cur->datum #'e1) ,(cur->datum #'e2)))]))))
|
(term (,(cur->datum #'e1) ,(cur->datum #'e2)))]))))
|
||||||
(unless (or inner-expand? (type-infer/term reified-term))
|
(unless (or (inner-expand?) (type-infer/term reified-term))
|
||||||
;; TODO: is this really a syntax error?
|
#;(printf "Sigma: ~s~nGamma: ~s~n" (sigma) (gamma))
|
||||||
(raise-syntax-error 'cur "term is ill-typed:"
|
(raise-syntax-error 'cur "term is ill-typed:" reified-term syn))
|
||||||
(begin (printf "Sigma: ~s~nGamma: ~s~n" (sigma) (gamma))
|
|
||||||
reified-term)
|
|
||||||
syn))
|
|
||||||
reified-term)
|
reified-term)
|
||||||
|
|
||||||
(define (datum->cur syn t)
|
(define (datum->cur syn t)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user