Is there a common ancestor for `String` and `Char`...
# getting-started
a
Is there a common ancestor for
String
and
Char
?
r
Only really
Any
.
Char
represents a single character,
String
an immutable list of characters, so it's hard to see what common supertype they could have. (They can also both inherit from
Comparable<*>
, but that's not a lot of use...)
🙏 1
e
pretty much. the variance is
Comparable<in T>
, so
Comparable<*>
is effectively
Comparable<Nothing>
which is useless 😄