[racket] typed/racket and contract boundaries

From: Sam Tobin-Hochstadt (samth at cs.indiana.edu)
Date: Mon Jan 27 16:43:21 EST 2014

On Mon, Jan 27, 2014 at 4:35 PM, Asumu Takikawa <asumu at ccs.neu.edu> wrote:
> On 2014-01-27 08:40:38 -0800, Eric Dobson wrote:
>> This is likely a bug, but I cannot reproduce using the following
>> program. Do you have a small test case?
>
> I talked to Spencer and we found this example that produces the same
> output:
>
>   (module a typed/racket
>     (: g ((U (Parameterof (-> Void)) (-> Void)) -> Void))
>     (define (g p) p (void))
>     (provide g))
>   (require 'a)
>   (g (make-parameter void))
>
> It seems to be specific to having a `Parameterof` containing a
> function type unioned with a function type.

Here's the bug without TR:

#lang racket
(module b racket
  (define (g p) p (void))
  (provide/contract [g
                     (-> (or/c (parameter/c (-> void?))
                               (-> void?))
                         void?)]))
(require 'b)
(g (make-parameter void))

Gives the error:

sw/plt/racket/collects/racket/contract/private/blame.rkt:245:0:
default-blame-format: contract violation
  expected: a blame object with a non-#f positive field
  given: #<blame>

Sam

Posted on the users mailing list.