Correctly protect Procedures in TR.
Closes PR 13664.
(cherry picked from commit fc36c12ce4
)
This commit is contained in:
parent
3590b9681e
commit
eff170b33e
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))
|
(loop t (not pos?) (not from-typed?) structs-seen kind))
|
||||||
(define (t->c/fun f #:method [method? #f])
|
(define (t->c/fun f #:method [method? #f])
|
||||||
(match f
|
(match f
|
||||||
[(Function: (list (top-arr:))) (if pos? #'(case->) #'procedure?)]
|
[(Function: (list (top-arr:))) #'(case->)]
|
||||||
[(Function: arrs)
|
[(Function: arrs)
|
||||||
(set-chaperone!)
|
(set-chaperone!)
|
||||||
;; Try to generate a single `->*' contract if possible.
|
;; Try to generate a single `->*' contract if possible.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user