]> gitweb.factorcode.org Git - factor.git/commitdiff
slots: add initial value for integer-array-capacity, fixes part of #1571
authorBjörn Lindqvist <bjourne@gmail.com>
Mon, 21 Mar 2016 17:10:39 +0000 (18:10 +0100)
committerBjörn Lindqvist <bjourne@gmail.com>
Mon, 21 Mar 2016 17:10:39 +0000 (18:10 +0100)
core/classes/tuple/tuple-tests.factor
core/slots/slots.factor

index ea1deadf9487fe815ff824fb0fd214e075548d2a..c702cc03a6174eb43c6f79ca34439091059691ee 100644 (file)
@@ -701,6 +701,16 @@ TUPLE: boa-coercer-test { x array-capacity } ;
 
 { T{ boa-coercer-test f 0 } } [ T{ boa-coercer-test } ] unit-test
 
+TUPLE: boa-iac { x integer-array-capacity initial: 77 } ;
+
+{ fixnum bignum 77 } [
+    30 boa-iac boa x>> class-of
+    10 >bignum boa-iac boa x>> class-of
+    boa-iac new x>>
+] unit-test
+
+[ -99 boa-iac boa ] [ bad-slot-value? ] must-fail-with
+
 ! Make sure that tuple reshaping updates code heap roots
 TUPLE: code-heap-ref ;
 
index e3f6ea995bea0d863bc354005b571b4c1440387e..6d393f125523fa235a48730db397007e950f88f0 100644 (file)
@@ -203,6 +203,7 @@ M: anonymous-intersection initial-value*
         { [ dup "initial-value" word-prop ] [ dup "initial-value" word-prop t ] }
         { [ \ f bootstrap-word over class<= ] [ f t ] }
         { [ \ array-capacity bootstrap-word over class<= ] [ 0 t ] }
+        { [ \ integer-array-capacity bootstrap-word over class<= ] [ 0 t ] }
         { [ bignum bootstrap-word over class<= ] [ 0 >bignum t ] }
         { [ float bootstrap-word over class<= ] [ 0.0 t ] }
         { [ string bootstrap-word over class<= ] [ "" t ] }