I know this question has been asked before, but either the answers don't apply to this case, or I don't understand them.
Basically, why doesn't the following (simple example that recreates my problem) work ?
class Test[+T] {
var list: List[T] = _
}
The problem I am having is that I have an object, where I want to pass in an instance of Test[Nothing]
(the empty Test
), and this doesn't work unless I make Test
co-variant in T
.