Skip to content

Commit

Permalink
Allow requiring functions with filters in contravariant positions.
Browse files Browse the repository at this point in the history
  • Loading branch information
endobson committed Apr 25, 2013
1 parent 03e1ffd commit dbcb141
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#lang racket/load

(module untyped racket
(provide f)
(define (f g) 'g))


(module typed typed/racket
(require/typed 'untyped
[f ((Any -> Boolean : Symbol) -> Symbol)]))

(require 'typed)
2 changes: 1 addition & 1 deletion collects/typed-racket/private/type-contract.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
(and rst (t->c/neg rst))))]
;; functions with filters or objects
[(arr: dom (Values: (list (Result: rngs _ _) ...)) rst #f '())
(if (and from-typed? pos?)
(if from-typed?
(values (map t->c/neg dom)
null
(map t->c rngs)
Expand Down

0 comments on commit dbcb141

Please sign in to comment.