Skip to content

Instantly share code, notes, and snippets.

@Havvy
Created June 8, 2013 07:16
Show Gist options
  • Save Havvy/5734382 to your computer and use it in GitHub Desktop.
Save Havvy/5734382 to your computer and use it in GitHub Desktop.
#lang typed/racket
(define-type my/symbol Symbol)
(define-type my/map (HashTable my/any my/any))
(define-type my/any (U my/symbol
my/map))
; Works
(define (a-map : my/map) #hash{[:call . :q]})
; Fails
;types-2.rkt:15:26: Type Checker: Expected my/map, but got (HashTable my/symbol my/symbol) in: #hash((:call . :q))
; #(411 19)
(: a-map-outer-typed my/map)
(define a-map-outer-typed #hash{[:call . :q]})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment