PasteRack.org
Paste # 45469
2015-02-28 15:41:29

Fork as a new paste.

Paste viewed 475 times.


Embed:

format-id

  1. #lang racket
  2.  
  3. (module foo typed/racket
  4.   (require/typed racket/syntax
  5.                  [format-id (Syntax String Any * -> Identifier)])
  6.   (provide f)
  7.   (: f (Syntax -> Syntax))
  8.   (define (f stx)
  9.     (format-id stx "hello")))
  10.  
  11. (require (submod "." foo))
  12.  
  13. (f #'bar)

=>

eval:2:0: Type Checker: could not convert type to a

contract;

 required a flat contract but generated a chaperone contract

  for identifier: f

  type: (-> Syntax Syntax)

  in: (f (syntax bar))