Thread
#stdlib
    d

    Dave Leeds

    4 years ago
    Hello! I'm doing some research on type aliases, so I'm looking through the standard library to see how
    typealias
    is used. I've found that it's most frequently used to map some common classes (e.g., exceptions,
    StringBuilder
    ,
    ArrayList
    ,
    Serializable
    ) to the corresponding Java classes. I was curious if @ilya.gorbunov or someone else at JB can fill me in on the purpose of these particular aliases in the standard library. Are they intended to save on imports (e.g., no need to import
    java.util.*
    if
    ArrayList
    is found in
    kotlin.collections
    )? Or to give Kotlin the flexibility to expand on the interface of those classes in the future? Or something else? Thanks!
    gildor

    gildor

    4 years ago
    Those typealiases created for multiplatform projects Not all of them currently available for multiplatofrm, but many of them (exceptions,
    StringBuilder
    ,
    ArrayList
    , but not Serializable)
    d

    Dave Leeds

    4 years ago
    Okay, gotcha... So, in the case of the JVM, it's just a type alias, but in the case of JS, there's an implementation of each... yes?
    gildor

    gildor

    4 years ago
    yes
    d

    Dave Leeds

    4 years ago
    Thanks!
    gildor

    gildor

    4 years ago
    Also some APIs are still JVM only, but already part of Kotlin stdlib, maybe for future usage