https://kotlinlang.org logo
Title
m

mc

12/10/2017, 1:12 PM
Hi, is there a reason why the following class wouldn't compile?
class Example {

    private val backingMap = mutableMapOf<String, MutableSet<String>>()

    fun addVertex(v: String): Boolean = backingMap.putIfAbsent(v, mutableSetOf()) == null
    
    fun addEdge(v: String, w: String): Boolean {
        listOf(v, w).map(::addVertex)
        return backingMap[v]!!.add(w)
    }

}
l

louiscad

12/10/2017, 1:56 PM
We can't tell with the provided info
k

karelpeeters

12/10/2017, 1:58 PM
I compiled the code myself and I got an internal compiler error about the inline of
map
.
l

louiscad

12/10/2017, 1:59 PM
@karelpeeters Could you try compiling it in Kotlin 1.1 instead of 1.2 and tell me if the error is still there?
I mean 1.1.60