Lower typed bytevector allocation to Kotlin

ober

fc3264c8101a7892d13b11b8c223946df95adaf5

diff --git a/lib/jerboa/typed/kotlin/lower.ss b/lib/jerboa/typed/kotlin/lower.ss
index c1486fc..ba292ed 100644
--- a/lib/jerboa/typed/kotlin/lower.ss
+++ b/lib/jerboa/typed/kotlin/lower.ss
@@ -627,6 +627,14 @@
            (car args)
            'decodeToString
            '())]
+        [(make-bytevector)
+         (make-kt-call
+           (kt-name1 'ByteArray)
+           (list
+             (lower-to-kotlin-int (car (typed-ir-call-args ir)))
+             (make-kt-lambda
+               '(index)
+               (make-kt-member-call (cadr args) 'toByte '()))))]
         [(jvm-bytes-lower-hex)
          (make-kt-member-call
            (make-kt-member-call
diff --git a/tests/test-typed-kotlin.ss b/tests/test-typed-kotlin.ss
index 77cec51..c733522 100644
--- a/tests/test-typed-kotlin.ss
+++ b/tests/test-typed-kotlin.ss
@@ -896,6 +896,19 @@
   bytes-build-kotlin
   "java.math.BigInteger(1, items).toString(16).padStart((items.size * 2), '0')")
 
+(define make-bytevector-form
+  '(typed-library (sample typed bytevector)
+     (export scratch)
+     (def (scratch) : Bytes
+       (make-bytevector (int32 32768) 0))))
+
+(define make-bytevector-kotlin
+  (typed-library-form->kotlin-string make-bytevector-form))
+
+(test-contains "make-bytevector lowers to Kotlin ByteArray"
+  make-bytevector-kotlin
+  "ByteArray(32768, { index -> 0uL.toByte() })")
+
 (define utf8-form
   '(typed-library (sample typed utf8)
      (export encode decode encodedLength)