I have:
data class Edge(val spec: String, val weight: Int)
private val graph: SortedSetMultimap<String, Edge> = TreeMultimap.create()
The call to create() is an error:
MapCrawler.kt: (63, 71): Type inference failed. Expected type mismatch: inferred type is TreeMultimap<(???..???), (???..???)>! but SortedSetMultimap was expected
If I change it to be a
SortedSetMultimap<String, String>
it works fine (no issues with the type inference). In other words, this line compiles just fine:
private val graph: SortedSetMultimap<String, String> = TreeMultimap.create()
What is it about the Edge class that messes up the type inference, and how do I fix it?