]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix erg's bug
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 4 Sep 2008 04:38:32 +0000 (23:38 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 4 Sep 2008 04:38:32 +0000 (23:38 -0500)
core/generic/generic-tests.factor
core/generic/generic.factor

index ab39cbcbb8afce0f6db7f16e7d3fd531b1e21f4e..22c690ffaf1f185832a75160b7e0fedadc6efaf8 100755 (executable)
@@ -2,7 +2,7 @@ USING: accessors alien arrays definitions generic generic.standard
 generic.math assocs hashtables io kernel math namespaces parser
 prettyprint sequences strings tools.test vectors words
 quotations classes classes.algebra classes.tuple continuations
-layouts classes.union sorting compiler.units eval ;
+layouts classes.union sorting compiler.units eval multiline ;
 IN: generic.tests
 
 GENERIC: foobar ( x -- y )
@@ -135,7 +135,7 @@ M: f tag-and-f 4 ;
 [ 3.4 3 ] [ 3.4 tag-and-f ] unit-test
 
 ! Issues with forget
-GENERIC: generic-forget-test-1
+GENERIC: generic-forget-test-1 ( a b -- c )
 
 M: integer generic-forget-test-1 / ;
 
@@ -187,7 +187,7 @@ M: f generic-forget-test-3 ;
 
 : a-word ;
 
-GENERIC: a-generic
+GENERIC: a-generic ( a -- b )
 
 M: integer a-generic a-word ;
 
@@ -198,3 +198,27 @@ M: integer a-generic a-word ;
 [ ] [ "IN: generic.tests : a-generic ;" eval ] unit-test
 
 [ f ] [ "m" get \ a-word usage memq? ] unit-test
+
+! erg's regression
+[ ] [
+    <"
+    IN: compiler.tests
+
+    GENERIC: jeah ( a -- b )
+    TUPLE: boii ;
+    M: boii jeah ;
+    GENERIC: jeah* ( a -- b )
+    M: boii jeah* jeah ;
+    "> eval
+
+    <"
+    IN: compiler.tests
+    FORGET: boii
+    "> eval
+    
+    <"
+    IN: compiler.tests
+    TUPLE: boii ;
+    M: boii jeah ;
+    "> eval
+] unit-test
index f2c154b3b25a7686abf30d6b48ef9d40cb1d0210..c0a21dbaba3def9070746cea7005dff9ff931c33 100755 (executable)
@@ -130,7 +130,7 @@ M: method-spec definition
     first2 method definition ;
 
 M: method-spec forget*
-    first2 method forget* ;
+    first2 method [ forgotten-definition ] [ forget* ] bi ;
 
 M: method-spec smart-usage
     second smart-usage ;