Correctly protect Procedures in TR.
Closes PR 13664. original commit: fc36c12ce4df96cca4df053fa5e0f4c4969b7e8a
This commit is contained in:
parent
6350738866
commit
6b45173588
20
collects/tests/typed-racket/fail/pr13664.rkt
Normal file
20
collects/tests/typed-racket/fail/pr13664.rkt
Normal 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)
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user