diff --git a/basis/compiler/tree/propagation/transforms/transforms.factor b/basis/compiler/tree/propagation/transforms/transforms.factor index 3b387a2254..5dc417b8e7 100644 --- a/basis/compiler/tree/propagation/transforms/transforms.factor +++ b/basis/compiler/tree/propagation/transforms/transforms.factor @@ -178,7 +178,13 @@ ERROR: bad-partial-eval quot word ; \ instance? [ dup classoid? - [ predicate-def ] [ drop f ] if + [ + predicate-def + ! union{ and intersection{ have useless expansions, and recurse infinitely + dup { [ length 2 >= ] [ second \ instance? = ] } 1&& [ + drop f + ] when + ] [ drop f ] if ] 1 define-partial-eval ! Shuffling diff --git a/basis/prettyprint/prettyprint-tests.factor b/basis/prettyprint/prettyprint-tests.factor index 49dcbab433..3df231db96 100644 --- a/basis/prettyprint/prettyprint-tests.factor +++ b/basis/prettyprint/prettyprint-tests.factor @@ -393,7 +393,6 @@ TUPLE: bob a b ; [ "maybe: bob\n" ] [ [ maybe: bob . ] with-string-writer ] unit-test [ "maybe: word\n" ] [ [ maybe: word . ] with-string-writer ] unit-test - TUPLE: har a ; GENERIC: harhar ( obj -- obj ) M: maybe: har harhar ; @@ -408,12 +407,11 @@ M: integer harhar M\\ integer harhar drop ;\n""" [ \ harhar see-methods ] with-string-writer ] unit-test - TUPLE: mo { a union{ float integer } } ; TUPLE: fo { a intersection{ fixnum integer } } ; [ -"""USING: classes.union math ; +"""USING: math ; IN: prettyprint.tests TUPLE: mo { a union{ float integer } initial: 0 } ; """ @@ -422,7 +420,7 @@ TUPLE: mo { a union{ float integer } initial: 0 } ; ] unit-test [ -"""USING: classes.intersection math ; +"""USING: math ; IN: prettyprint.tests TUPLE: fo { a intersection{ fixnum integer } initial: 0 } ; """