• treelzebub

    treelzebub

    5 years ago
    is anyone else getting spurious compiler errors when using
    internal typealias
    ?
    Error:(107, 91) Cannot access 'ValidationErrors': it is internal in ‘[module]’
    usages are all also in
    [module]
    treelzebub
    ilya.gorbunov
    6 replies
    Copy to Clipboard
  • kirillrakhman

    kirillrakhman

    5 years ago
    sure, just make sure your collection is actually mutable
    kirillrakhman
    1 replies
    Copy to Clipboard
  • b

    beholder

    5 years ago
    Did I miss something or there is no function for mapping array to array? (there is only array to list)
    b
    miha-x64
    2 replies
    Copy to Clipboard
  • a

    Andreas Sinz

    5 years ago
  • louiscad

    louiscad

    5 years ago
    @mg6maciej
    val newList = list.minusIndex(i)
    louiscad
    m
    11 replies
    Copy to Clipboard
  • m

    mg6maciej

    5 years ago
    I wonder if Kotlin's persistent collections have these missing APIs.
    m
    ilya.gorbunov
    8 replies
    Copy to Clipboard
  • m

    mg6maciej

    5 years ago
    Is there a function that uses
    IndexedValue
    or do I just call it
    .mapIndexed(::IndexedValue)
    ?
    m
    1 replies
    Copy to Clipboard
  • orangy

    orangy

    5 years ago
    Beware that
    subList
    is a view. If original list changes, then sublist also changes.
    orangy
    m
    3 replies
    Copy to Clipboard
  • ilya.gorbunov

    ilya.gorbunov

    5 years ago
    @mg6maciej AFAIK, an internal typealias in a public signature should be replaced with its public substitution, but that feature may be not working.
    ilya.gorbunov
    m
    2 replies
    Copy to Clipboard
  • c

    cedric

    5 years ago
    @orangy The following code throws, is this the expected behavior? It looks like
    copyRecursively
    is changing the target from a directory to a file:
    fun main(args: Array<String>) {
        val from = File("/tmp/foo").apply { writeText("I'm a file") }
        val to = File("/tmp/to").apply {
            deleteRecursively()
            mkdirs()
        }
        from.copyRecursively(to, overwrite = true)
        if (! to.isDirectory) {
            throw AssertionError("Should be a directory")
        }
    }
    c
    orangy
    2 replies
    Copy to Clipboard