var a: some Equatable = 10
var c: some Equatable = 10
a = c // ERROR: Cannot assign value of type 'some Equatable' (type of 'c') to type 'some Equatable' (type of 'a')
You can't pass a different some Equatable
to a
. The compiler can't guarantee if a
and c
have identical underlying concrete types. Even though on the screen you can see c
is an Int
, to the compiler it's just some Equatable
. It's NOT some Equatable_But_really_an_Int
.
Because it's some Equatable
then the compiler would be like, then 'What if c
was "ten"
? Let's just be safe an not allow it'