Lower typed Kotlin vararg arrays as element parameters
ober
d2d02fb5b44d6fbfeb2aa3842ad44522fad5187b
--- a/lib/jerboa/typed/kotlin/lower.ss +++ b/lib/jerboa/typed/kotlin/lower.ss @@ -995,10 +995,19 @@ (typed-variant-cases variant)) '())) + (def (lower-param-type param) + (let ([type (typed-param-type param)]) + (if (and (memq 'vararg (typed-param-modifiers param)) + (pair? type) + (eq? (car type) 'Array) + (= (length type) 2)) + (typed-type->kotlin-type (cadr type)) + (typed-type->kotlin-type type)))) + (def (lower-param param) (make-kt-param (typed-param-name param) - (typed-type->kotlin-type (typed-param-type param)) + (lower-param-type param) #f (typed-param-property param) (typed-param-mutable? param) --- a/tests/test-typed-kotlin.ss +++ b/tests/test-typed-kotlin.ss @@ -1575,7 +1575,7 @@ (type Button) (class Store ((context : Context (property val) (visibility private))) (def (ready) : Bool #t)) - (def (row (buttons : Button (modifiers vararg))) : Unit + (def (row (buttons : (Array Button) (modifiers vararg))) : Unit (begin)))) (define return-form