From ecbd63562be843f188880b17da33dca9f9b22452 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Mon, 10 May 2010 17:53:48 -0400 Subject: [PATCH 1/2] fix handling when subtype doesn't have rest arg original commit: 2d1625336e2512ba4df3a93fc28682c32be48ceb --- collects/typed-scheme/types/subtype.rkt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/collects/typed-scheme/types/subtype.rkt b/collects/typed-scheme/types/subtype.rkt index 64cbbc2c..19cde898 100644 --- a/collects/typed-scheme/types/subtype.rkt +++ b/collects/typed-scheme/types/subtype.rkt @@ -144,6 +144,9 @@ (subtypes*/varargs t-dom s-dom s-rest) (kw-subtypes* t-kws s-kws) (subtype* s-rng t-rng))] + [((arr: s-dom s-rng #f #f s-kws) + (arr: t-dom t-rng t-rest #f t-kws)) + (fail! s t)] [((arr: s-dom s-rng s-rest #f s-kws) (arr: t-dom t-rng t-rest #f t-kws)) (subtype-seq A0 @@ -352,7 +355,6 @@ ;(trace subtype*) ;(trace supertype-of-one/arr) ;(trace arr-subtype*/no-fail) -;(trace subtype-of-one) ;(trace subtype*/no-fail) ;(trace subtypes*) ;(trace subtype) From 507309df274cf83df389e78f1d5228021b56d124 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Mon, 10 May 2010 17:55:29 -0400 Subject: [PATCH 2/2] add test for bug found by vincent original commit: a81de56b302dcf9a44c496967df3d40e3d5779f5 --- collects/tests/typed-scheme/unit-tests/subtype-tests.rkt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/collects/tests/typed-scheme/unit-tests/subtype-tests.rkt b/collects/tests/typed-scheme/unit-tests/subtype-tests.rkt index b43e4c02..d6f28570 100644 --- a/collects/tests/typed-scheme/unit-tests/subtype-tests.rkt +++ b/collects/tests/typed-scheme/unit-tests/subtype-tests.rkt @@ -124,7 +124,8 @@ (FAIL (-poly (a b) (-> a a)) (-poly (a b) (-> a b))) ;; polymorphic function types should be subtypes of the function top - [(-poly (a) (a . -> . a)) top-func] + [(-poly (a) (a . -> . a)) top-func] + (FAIL (-> Univ) (null Univ . ->* . Univ)) [(cl->* (-Number . -> . -String) (-Boolean . -> . -String)) ((Un -Boolean -Number) . -> . -String)] ))