Don't compare non-identifiers with free-id=?.

Closes PR 14877.
This commit is contained in:
Sam Tobin-Hochstadt 2014-12-10 17:53:46 -05:00
parent 9defa4b492
commit 933e571125
2 changed files with 6 additions and 2 deletions

View File

@ -24,7 +24,7 @@
(define-tc/app-syntax-class (tc/app-lambda expected)
#:literal-sets (kernel-literals)
;; let loop
(pattern ((letrec-values ([(lp) (~and lam (#%plain-lambda (args ...) . body))]) lp*) . actuals)
(pattern ((letrec-values ([(lp) (~and lam (#%plain-lambda (args ...) . body))]) lp*:id) . actuals)
#:when expected
#:when (not (andmap type-annotation (syntax->list #'(lp args ...))))
#:when (free-identifier=? #'lp #'lp*)
@ -59,7 +59,7 @@
(syntax-parse #`(#,args #,body #,actuals)
#:literal-sets (kernel-literals lambda-literals)
[((val acc ...)
((~and inner-body (if (#%plain-app (~or pair? null?) val*) thn els)))
((~and inner-body (if (#%plain-app (~or pair? null?) val*:id) thn els)))
(actual actuals ...))
#:when
(and (free-identifier=? #'val #'val*)

View File

@ -3350,6 +3350,10 @@
(ann (values a a) (Values Symbol Symbol)))
(void))
-Void]
[tc-e ((letrec ((loop (lambda: ([x : (Listof Integer)]) (cond ((null? (cdr x)) #t) (else #f))))) loop)
(list 1 2))
-Boolean]
)
(test-suite