add unit test to show that polymorphic check breaks inference of inline recursive words

db4
Joe Groff 2010-03-06 12:28:09 -08:00
parent 17df15280e
commit 68dd644233
1 changed files with 12 additions and 2 deletions

View File

@ -1,11 +1,13 @@
! (c)2010 Joe Groff bsd license
USING: effects fry io kernel math namespaces sequences
system tools.test
USING: accessors effects fry io kernel make math namespaces sequences
splitting system tools.test
stack-checker
stack-checker.backend
stack-checker.errors
stack-checker.row-polymorphism
stack-checker.state
stack-checker.values ;
FROM: splitting.private => split, ;
IN: stack-checker.row-polymorphism.tests
: infer-polymorphic-quot ( quot -- vars )
@ -49,6 +51,14 @@ H{ { "a" 0 } { "b" 0 } } [ [ drop ] [ ] if* ] test-poly-infer
H{ { "a" 0 } { "b" 1 } } [ [ 1 + ] [ "oops" throw ] if* ] test-poly-infer
H{ } [ [ [ member? ] curry split, ] { } make ] test-poly-infer
[ (( x x -- x )) ] [
t infer-polymorphic? [
[ [ [ member? ] curry split, ] { } make ] infer
] with-variable
] unit-test
[ [ write write ] each ] poly-infer-must-fail
[ [ ] each ] poly-infer-must-fail
[ [ dup ] map ] poly-infer-must-fail