compiler.tree.propagation.transforms: fix infinite recursion that was breaking prettyprint

db4
Doug Coleman 2011-11-23 00:48:05 -08:00
parent f90bc5cdb6
commit b37bebb17f
2 changed files with 9 additions and 5 deletions

View File

@ -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

View File

@ -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 } ;
"""