[racket] typed racket and interfaces

From: Alexander D. Knauth (alexander at knauth.org)
Date: Fri May 2 21:36:07 EDT 2014

On May 2, 2014, at 9:24 PM, dfeltey at ccs.neu.edu wrote:

> #:implements should be used inside of a Class type form.
> 
> The following is an example from the documentation:
> 
>> (define-type Point<%> (Class (field [x Real] [y Real])))
>> (: colored-point% (Class #:implements Point<%>
>                           (field [color String])))
I tried this:
#lang typed/racket

(module untyped racket
  (provide point% colored-point%)
  (define point%
    (class object% (super-new) (inspect #f)
      (init-field x y)))
  (define colored-point%
    (class point% (super-new) (inspect #f)
      (init-field color))))

(define-type Point<%> (Class (field [x Real] [y Real])))
(require/typed (submod "." untyped)
               [colored-point% (Class #:implements Point<%>
                                      (field [color String]))])
And it gave me this error:
. Type Checker: not a valid type: #:implements in: #:implements


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140502/42d6a56c/attachment.html>

Posted on the users mailing list.