public
Created

Why any-wrap/c is needed

  • Download Gist
any-c.rkt
Racket
1 2 3 4 5 6 7 8 9 10 11
#lang racket/load
 
(module m1 typed/racket
(: f : Integer -> Integer)
(define (f x) (add1 x))
(define: g : Any f) ;; safe by subtyping
(provide g))
 
(module m2 racket
(require 'm1)
(g "not a number")) ;; fails at runtime

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.