Cannot get type of generic object in a list
问题 I have the following trait: trait Storage[C <: Config] { def get(name: String, version: Int): Option[C] def list: List[(String, String)] def register(config: C): Boolean } and I want to create the following class: class MultiStorage[C <: Config](storages: List[Storage[_ <: C]]) extends Storage[C] { def get(name: String, version: Int): Option[C] = {...} def list: List[(String, String)] = {...} def register(config: C) = {...} If not clear, the meaning is that a MultiStorage stores elements of