From bafc7d93e793b3af9d7aba5e245e24eaf1220b35 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Mon, 9 Feb 2015 16:37:32 -0500 Subject: [PATCH] Raise proper errors when there are too many contract constraints. Fixes PR 14890. This could potentially be relaxed if needed, but this addresses the immediate issue. --- .../typed-racket/static-contracts/constraints.rkt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/typed-racket-lib/typed-racket/static-contracts/constraints.rkt b/typed-racket-lib/typed-racket/static-contracts/constraints.rkt index c6b6b422..0d595068 100644 --- a/typed-racket-lib/typed-racket/static-contracts/constraints.rkt +++ b/typed-racket-lib/typed-racket/static-contracts/constraints.rkt @@ -284,5 +284,15 @@ (raise (exn:fail:constraint-failure (format "Violated constraint: ~a" reason) (current-continuation-marks) - reason)))]))])) + reason)))] + [(contract-restrict (kind-max d _) rec constraints) + (raise (exn:fail:constraint-failure + (format "Violated constraint: ~a" "too many ids") + (current-continuation-marks) + (~a d)))]))] + [(contract-restrict (kind-max d _) rec constraints) + (raise (exn:fail:constraint-failure + (format "Violated constraint: ~a" "too many ids") + (current-continuation-marks) + (~a d)))]))