2020-02-26 19:50:35 +00:00
|
|
|
#lang typed/syndicate/roles
|
|
|
|
|
|
|
|
(require rackunit/turnstile)
|
|
|
|
|
|
|
|
(check-type
|
2020-08-17 15:24:06 +00:00
|
|
|
(let ()
|
2020-02-26 19:50:35 +00:00
|
|
|
(field [boo Int 0])
|
|
|
|
(define x (begin (send! "hi") 5))
|
|
|
|
;; relying on `set` not allowing effects for this to be a good test
|
|
|
|
(set! boo x)
|
|
|
|
3)
|
|
|
|
: Int)
|
|
|
|
|
|
|
|
;; Used to get the error:
|
|
|
|
; <pkgs>/syndicate/typed/tests/define-with-effects.rkt:10.2: set!: expression not allowed to have effects
|
|
|
|
; at: (set! boo x)
|
|
|
|
; in: (set! boo x)
|