Correctly protect Procedures in TR.

Closes PR 13664.

original commit: fc36c12ce4df96cca4df053fa5e0f4c4969b7e8a
This commit is contained in:
Eric Dobson 2013-04-06 12:05:57 -07:00
parent 6350738866
commit 6b45173588
2 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,20 @@
#;
(exn-pred #rx"arity mismatch")
#lang racket/load
(module untyped racket
(provide f)
(define (f g)
(g "foo")))
(module typed typed/racket
(require/typed 'untyped
[f (Procedure -> Any)])
(: g (Byte -> Natural))
(define (g x) (add1 x))
(f g))
(require 'typed)

View File

@ -129,7 +129,7 @@
(loop t (not pos?) (not from-typed?) structs-seen kind))
(define (t->c/fun f #:method [method? #f])
(match f
[(Function: (list (top-arr:))) (if pos? #'(case->) #'procedure?)]
[(Function: (list (top-arr:))) #'(case->)]
[(Function: arrs)
(set-chaperone!)
;; Try to generate a single `->*' contract if possible.