typed-racket icon indicating copy to clipboard operation
typed-racket copied to clipboard

Bindings re-exported in submodules are not protected by contracts

Open yjqww6 opened this issue 4 years ago • 1 comments

What version of Racket are you using?

8.0.0.12--2021-03-21(8bf8e3c/a) [cs]

What program did you run?

#lang racket

(module a typed/racket/base
  (define (f [a : Integer]) (add1 a))
  (module+ b
    (provide f)))

(require (submod 'a b))

(f #f)

What should have happened?

It should fail without calling add1.

If you got an error message, please include it here.

add1: contract violation
  expected: number?
  given: #f

yjqww6 avatar Mar 22 '21 09:03 yjqww6

This is probably failing to figure out that f is defined "locally" and thus needs a contract.

samth avatar Mar 22 '21 13:03 samth