GarouDan
06/15/2020, 10:32 PMSortedSet<String>
to pure array String[]
in Kotlin?serebit
06/15/2020, 10:34 PMtoTypedArray()
GarouDan
06/15/2020, 10:35 PMGarouDan
06/15/2020, 10:36 PMserebit
06/15/2020, 10:36 PM.gradle
, or .gradle.kts
GarouDan
06/15/2020, 10:37 PMgradle.kts
,
the related block is:
setPublications(publishing.publications.names.toTypedArray() as String[])
GarouDan
06/15/2020, 10:37 PMString[] publications
serebit
06/15/2020, 10:38 PMString[]
isn't a type in Kotlin, and you don't need to cast anything. toTypedArray
returns Array<String>
, which is Kotlin's version of String[]
serebit
06/15/2020, 10:39 PMsetPublications(publishing.publications.names.toTypedArray())
GarouDan
06/15/2020, 10:40 PMsetPublications(publishing.publications.names.toTypedArray())
^ Type mismatch: inferred type is Array<String!> but String! was expected
serebit
06/15/2020, 10:40 PMGarouDan
06/15/2020, 10:42 PMGarouDan
06/15/2020, 10:42 PMserebit
06/15/2020, 10:42 PM