Skip to content

unsoundness with require/typed #636

Open
@bennn

Description

@bennn

What version of Racket are you using?

6.10.1

What program did you run?

I sent a vector from one typed module to another, through a require/typed.
The require/typed let me change the vector's element type.

#lang racket/base

(module a typed/racket/base
  (provide f v)

  (: v (Vector (Boxof Natural)))
  (define v (vector (box 0)))

  (: f (-> Natural))
  (define (f)
    (unbox (vector-ref v 0))))

(module b typed/racket/base
  (require/typed (submod ".." a)
    (f (-> Natural))
    (v (Vectorof Integer)))

  (vector-set! v 0 0)
  (f))

(require 'b)

What should have happened?

Some kind of Racket error. Suggestions:

  • static type error, (Vectorof Integer) not compatible
  • runtime error, expected box got 0

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

segmentation fault

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions