Since str
is a structural subtype of Iterable[str]
, it follows that str & ~Iterable[str]
is Never
.
Instead, one needs a type alias for non-recursive collections, i.e. Iterable[T] & Not[T]
3 Likes