]> gitweb.factorcode.org Git - factor.git/commitdiff
typed: forgetting a final class would throw an error while recompiling typed words...
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 11 Mar 2010 21:22:35 +0000 (10:22 +1300)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 11 Mar 2010 21:22:35 +0000 (10:22 +1300)
basis/stack-checker/dependencies/dependencies.factor
basis/typed/typed-tests.factor

index e2f7c5759301cdd4a3ce908883221d13d781abef..7110fa77abd6b32b718c9c46b442457086679eb4 100644 (file)
@@ -141,7 +141,7 @@ TUPLE: depends-on-final class ;
     [ \ depends-on-final add-conditional-dependency ] bi ;
 
 M: depends-on-final satisfied?
-    class>> final-class? ;
+    class>> { [ class? ] [ final-class? ] } 1&& ;
 
 : init-dependencies ( -- )
     H{ } clone dependencies set
index 28ec2b6e86debc5386c59b449bee1dc232bae7ba..bca1136ee6bb57f44eefd378931a4d3526e5772e 100644 (file)
@@ -1,6 +1,6 @@
 USING: accessors effects eval kernel layouts math namespaces
 quotations tools.test typed words words.symbol
-compiler.tree.debugger prettyprint ;
+compiler.tree.debugger prettyprint definitions compiler.units ;
 IN: typed.tests
 
 TYPED: f+ ( a: float b: float -- c: float )
@@ -149,3 +149,12 @@ SYMBOL: a-symbol
         a-symbol get
     ] with-variable
 ] unit-test
+
+! Forgetting an unboxed final class should work
+TUPLE: forget-class { x read-only } ; final
+
+TYPED: forget-fail ( a: forget-class -- ) drop ;
+
+[ ] [ [ \ forget-class forget ] with-compilation-unit ] unit-test
+
+[ ] [ [ \ forget-fail forget ] with-compilation-unit ] unit-test