Created
June 8, 2013 07:16
-
-
Save Havvy/5734382 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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