Hi, is there a reason why the following class woul...
# announcements
m
Hi, is there a reason why the following class wouldn't compile?
Copy code
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
We can't tell with the provided info
k
I compiled the code myself and I got an internal compiler error about the inline of
map
.
l
@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