hold a literal for an array field to the field's length
A longer one reached cc as excess elements, and a shorter one filled the rest with zeros where a named array of that length was refused.
This commit is contained in:
@@ -228,6 +228,12 @@
|
||||
(test-assert "and as many as the field holds"
|
||||
(reports? "(sum t ((a ((xs [int 2])))))(fn f () t (var v [int 3] #(1 2 3)) (return (t/a v)))"
|
||||
"array is not as long as its field"))
|
||||
(test-assert "and so must a literal"
|
||||
(reports? "(sum t ((a ((xs [int 2])))))(fn f () t (return (t/a #(1 2 3))))"
|
||||
"array is not as long as its field"))
|
||||
(test-assert "not filling it with zeros either"
|
||||
(reports? "(sum t ((a ((xs [int 2])))))(fn f () t (return (t/a #(1))))"
|
||||
"array is not as long as its field"))
|
||||
(test-assert "an array field takes an array"
|
||||
(reports? "(sum t ((a ((xs [int 2])))))(fn f () t (var p (* int) 0) (return (t/a p)))"
|
||||
"an array field takes an array"))
|
||||
|
||||
Reference in New Issue
Block a user