add unit test to show that polymorphic check breaks inference of inline recursive words
							parent
							
								
									17df15280e
								
							
						
					
					
						commit
						68dd644233
					
				| 
						 | 
					@ -1,11 +1,13 @@
 | 
				
			||||||
! (c)2010 Joe Groff bsd license
 | 
					! (c)2010 Joe Groff bsd license
 | 
				
			||||||
USING: effects fry io kernel math namespaces sequences
 | 
					USING: accessors effects fry io kernel make math namespaces sequences
 | 
				
			||||||
system tools.test
 | 
					splitting system tools.test
 | 
				
			||||||
 | 
					stack-checker
 | 
				
			||||||
stack-checker.backend
 | 
					stack-checker.backend
 | 
				
			||||||
stack-checker.errors
 | 
					stack-checker.errors
 | 
				
			||||||
stack-checker.row-polymorphism
 | 
					stack-checker.row-polymorphism
 | 
				
			||||||
stack-checker.state
 | 
					stack-checker.state
 | 
				
			||||||
stack-checker.values ;
 | 
					stack-checker.values ;
 | 
				
			||||||
 | 
					FROM: splitting.private => split, ;
 | 
				
			||||||
IN: stack-checker.row-polymorphism.tests
 | 
					IN: stack-checker.row-polymorphism.tests
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: infer-polymorphic-quot ( quot -- vars )
 | 
					: 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{ { "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
 | 
					[ [ write write ] each      ] poly-infer-must-fail
 | 
				
			||||||
[ [             ] each      ] poly-infer-must-fail
 | 
					[ [             ] each      ] poly-infer-must-fail
 | 
				
			||||||
[ [ dup         ] map       ] poly-infer-must-fail
 | 
					[ [ dup         ] map       ] poly-infer-must-fail
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue