PasteRack.org
Paste # 48774
2018-11-05 18:52:34

Fork as a new paste.

Paste viewed 1818 times.


Embed:

vector-set! int to string

  1. #lang typed/racket
  2.  
  3. (: x (Immutable-Vectorof Integer))
  4. (define x #(3))
  5. (vector-set! x 0 "foo")

=>

eval:2:0: Type Checker: parse error in type;

 type name `Immutable-Vectorof' is unbound

  in: Integer

eval:4:0: Type Checker: type mismatch

  expected: Integer

  given: String

  in: "foo"