From dad2c26c496c3232b76d354a1d9f25e9c1d3e08a Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Thu, 8 Oct 2015 13:22:26 -0400 Subject: [PATCH] add existential tests demonstrating hidden type --- tapl/tests/exist-tests.rkt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tapl/tests/exist-tests.rkt b/tapl/tests/exist-tests.rkt index 4ddbf0d..1a98af0 100644 --- a/tapl/tests/exist-tests.rkt +++ b/tapl/tests/exist-tests.rkt @@ -76,6 +76,14 @@ (∃ (Counter) (× [new : Counter] [get : (→ Counter Int)] [inc : (→ Counter Counter)]))) +(typecheck-fail + (open ([(Counter counter) <= counterADT]) + (+ (proj counter new) 1)) + #:with-msg "Arguments to function \\+ have wrong type") +(typecheck-fail + (open ([(Counter counter) <= counterADT]) + ((λ ([x : Int]) x) (proj counter new))) + #:with-msg "Arguments to function.+have wrong type") (check-type (open ([(Counter counter) <= counterADT]) ((proj counter get) ((proj counter inc) (proj counter new))))