Intuitively I'd expect 'Test'[0] == 'T' to return true but it evaluates to false.
In equalArgs this lands in this case:
case let (lhs as AnyHashable, rhs as AnyHashable):
return lhs == rhs
This is due to rhs is a String while lhs is a Character.
This could be fixed by adding:
case let (lhs as _String, rhs as _String):
return lhs.substring == rhs.substring
However, this makes me wonder if all the other AnyHashable cases should also get _Substring variants. Alternatively, the _String cases in arrayEvaluator could be changed to always return a String, but that could lead to inefficiencies.
Any suggestions on how best to address this? Or does this work as expected?
Intuitively I'd expect
'Test'[0] == 'T'
to returntrue
but it evaluates tofalse
.In
equalArgs
this lands in this case:This is due to
rhs
is aString
whilelhs
is aCharacter
.This could be fixed by adding:
However, this makes me wonder if all the other
AnyHashable
cases should also get_Substring
variants. Alternatively, the_String
cases inarrayEvaluator
could be changed to always return aString
, but that could lead to inefficiencies.Any suggestions on how best to address this? Or does this work as expected?