Closed fniephaus closed 3 years ago
This should definitely work, but it's an interesting case. It's a bit more tricky than it looks at first, since "in" works for both string search and array element search. @eregon - out of curiosity, what does a Ruby string look like at the interop level? I assume it's both an array and a string?
Technically, languages could of course expose strings as interop strings and with interop array elements. But I think what the in
operator should do is simple:
If its a string (or interop string), do a string search. Otherwise, if its an array (or interop array), do an array element search.
Ruby Strings implement isString
/asString
, but not hasArrayElements
.
It's the same for the default exports of java.lang.String
.
Title says it all :)
Repro