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:
@@ -715,7 +715,12 @@
|
||||
(convert-to-closure type arg env form)
|
||||
(let ((given (expression-type arg env)))
|
||||
(cond
|
||||
((brace-initializer? arg) arg)
|
||||
((brace-initializer? arg)
|
||||
(let ((held (array-length type)))
|
||||
(when (and held (not (= held (length (remove comment-form?
|
||||
(vector->list arg))))))
|
||||
(sex-error form "array is not as long as its field" (first field))))
|
||||
arg)
|
||||
((not (array-form? given))
|
||||
(sex-error form "an array field takes an array" (first field)))
|
||||
((not (eqv? (array-length given) (array-length type)))
|
||||
|
||||
Reference in New Issue
Block a user