diff --git a/basis/compiler/tree/modular-arithmetic/modular-arithmetic-tests.factor b/basis/compiler/tree/modular-arithmetic/modular-arithmetic-tests.factor index 8b7c3a57f5..0e6161078a 100644 --- a/basis/compiler/tree/modular-arithmetic/modular-arithmetic-tests.factor +++ b/basis/compiler/tree/modular-arithmetic/modular-arithmetic-tests.factor @@ -21,10 +21,12 @@ IN: compiler.tree.modular-arithmetic.tests TUPLE: declared-fixnum { x fixnum } ; -[ t ] [ - [ { declared-fixnum } declare [ 1 + ] change-x ] - { + fixnum+ >fixnum } inlined? -] unit-test +! XXX: As of .97, we do a bounds check and throw an error on overflow, so we can't +! use fixnum+ here. If this is too big a regression, we can revert it. +! [ t ] [ + ! [ { declared-fixnum } declare [ 1 + ] change-x ] + ! { + fixnum+ >fixnum } inlined? +! ] unit-test [ t ] [ [ { declared-fixnum } declare x>> drop ] diff --git a/basis/compiler/tree/modular-arithmetic/modular-arithmetic.factor b/basis/compiler/tree/modular-arithmetic/modular-arithmetic.factor index 2aafeebdd8..135a63692d 100644 --- a/basis/compiler/tree/modular-arithmetic/modular-arithmetic.factor +++ b/basis/compiler/tree/modular-arithmetic/modular-arithmetic.factor @@ -39,9 +39,7 @@ IN: compiler.tree.modular-arithmetic ! is a modular arithmetic word, then the input can be converted into ! a form that is cheaper to compute. { - >fixnum - bignum>fixnum bignum>fixnum-strict - integer>fixnum integer>fixnum-strict + >fixnum bignum>fixnum integer>fixnum float>fixnum set-alien-unsigned-1 set-alien-signed-1 set-alien-unsigned-2 set-alien-signed-2 diff --git a/basis/typed/typed-tests.factor b/basis/typed/typed-tests.factor index 89347cbbb7..2c255e388c 100644 --- a/basis/typed/typed-tests.factor +++ b/basis/typed/typed-tests.factor @@ -1,7 +1,7 @@ USING: accessors effects eval kernel layouts math namespaces quotations tools.test typed words words.symbol combinators.short-circuit compiler.tree.debugger prettyprint definitions compiler.units sequences -classes.intersection strings classes.union kernel.private ; +classes.intersection strings classes.union ; IN: typed.tests TYPED: f+ ( a: float b: float -- c: float ) @@ -13,8 +13,12 @@ TYPED: f+ ( a: float b: float -- c: float ) TYPED: fix+ ( a: fixnum b: fixnum -- c: fixnum ) + ; -most-positive-fixnum neg 1 - 1quotation -[ most-positive-fixnum 1 fix+ ] unit-test +! XXX: As of .97, we don't require that the output is a fixnum. +! most-positive-fixnum neg 1 - 1quotation +! [ most-positive-fixnum 1 fix+ ] unit-test + +! XXX: Check that we throw an error. This used to underflow to the least-positive-fixnum. +[ most-positive-fixnum 1 fix+ ] [ { "kernel-error" 7 } head? ] must-fail-with TUPLE: tweedle-dee ; final TUPLE: tweedle-dum ; final