From f8928affc2d3123f6ebf32beadd8ac63995bf06a Mon Sep 17 00:00:00 2001 From: ben Date: Sat, 12 Mar 2016 12:44:43 -0500 Subject: [PATCH] [math] check that overriding operators fails --- test/math-fail.rkt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/math-fail.rkt b/test/math-fail.rkt index 332fdc3..fb87c36 100644 --- a/test/math-fail.rkt +++ b/test/math-fail.rkt @@ -24,4 +24,10 @@ ;; -- dividing by zero => caught statically (/: 1 1 0) (/: 1 1 (+: 4 -2 -2)) + ;; -- redefine ops => fail + (ann (let ([+: (lambda (x y) "hello")]) (+: 1 1)) Integer) + (ann (let ([-: (lambda (x y) "hello")]) (-: 1 1)) Integer) + (ann (let ([/: (lambda (x y) "hello")]) (/: 1 1)) Integer) + (ann (let ([*: (lambda (x y) "hello")]) (*: 1 1)) Integer) + (ann (let ([expt: (lambda (x y) "hello")]) (expt: 1 1)) Integer) ))