Using Self in generics

It certainly shouldn't segfault (please file a bug at https://bugs.swift.org!) but the problem here is that any subclasses of Game would have a different type. That is, it's not obvious that a PassthroughSubject<CardGame, Never> is a kind of PassthroughSubject<Game, Never>, even though CardGame is a kind of Game. This feature is called "covariant generic parameters" and would be non-trivial to add to Swift.

1 Like