commit 3c223663f0d856359680fa33465fe0071baa70ce
parent 1e05e62963bf5d7c3c0f19dca20906b0556e1a26
Author: Stephen Chang <stchang@ccs.neu.edu>
Date: Fri, 8 Aug 2014 16:53:19 -0400
add void to end of module begin of stlc; add some recursive tests
Diffstat:
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/stlc-tests.rkt b/stlc-tests.rkt
@@ -78,3 +78,7 @@
=> (cons {Int} 2 (cons {Int} 3 (null {Int}))))
(check-not-type (map add1 (cons {Int} 1 (cons {Int} 2 (null {Int}))))
: (Listof String))
+
+(define (a [x : Int]) (b x))
+(define (b [x : Int]) (a x))
+(define (ff [x : Int]) (ff x))
diff --git a/stlc.rkt b/stlc.rkt
@@ -336,7 +336,7 @@
; #:when (printf "mb: ~a\n" (syntax->datum (expand/df #'(letrec ([f v] ...) e ...))))
(quasisyntax/loc stx
(#%module-begin
- #,(expand/df #'(letrec/tc ([f : τ v] ...) e ...))
+ #,(expand/df #'(letrec/tc ([f : τ v] ...) e ... (void)))
(define #,(datum->syntax stx 'runtime-env)
(for/hash ([x:τ '#,(map (λ (xτ) (cons (car xτ) (syntax->datum (cdr xτ))))
(hash->list (do-subst (Γ))))])