[racket] Contracts and submodules
Dear list members,
Case 1 below doesn't give a contract violation but case 2 does. Is
this desired behavour or is it a bug?
In DrRacket
Case 1
---------
#lang racket
(provide (contract-out [ident-number (-> number? number?)]))
(define (ident-number x) x)
(module+ main
(ident-number 'a))
> 'a
Case 2
------------
#lang racket
(provide (contract-out [ident-number (-> number? number?)]))
(define (ident-number x) x)
(module+ main
(require (submod ".."))
(ident-number 'a))
>
ident-number: contract violation
expected: number?
given: 'a
in: the 1st argument of
(-> number? number?)
contract from:
c:\users\harry\ocr_project\test2.rkt
blaming:
(c:\users\harry\ocr_project\test2.rkt main)
at: c:\users\harry\ocr_project\test2.rkt:2.24
Thanks,
Harry Spier