On 8/18/2017 12:28 PM, Richard Eckart de Castilho wrote:
> On 18.08.2017, at 15:27, Marshall Schor <[email protected]> wrote:
>> This was a surprise to me, when I first learned of it.
>>
>> I guess I had implicitly assumed that if I said
>> -moveTo(aFooSub_b),
>> --where there was a type FooSub_b which was "equal" (using the index's
>> compare operation)
>> a subsequent "get" would get a FooSub_b instance.
>>
>> Instead, I get the "left-most" FS in the index which compares "equal" with
>> xxx,
>> which could be a FooSub_a instance
>> - which is neither a sub or supertype of xxx
> You obtain your iterator from an index-over-FooSub_a.
>
> Everything that you get back from this index should be a FooSub_a or a
> subtype.
>
> If you tell an iterator over this index to moveTo(xxx), then it would set the
> iterator pointer to the insertion location of xxx.
>
> I don't find it surprising that the iterator will return a FooSub_a or a
> subtype
> instead of a xxx.
>
> What I find a bit of surprising is, that the moveTo(xxx) operation accepts the
> xxx in the first place. Let's say you define an index over the feature A and
> xxx does not even have the feature A. It seems a proper reaction in this case
> would be an illegal argument exception.
I agree, seems strange. Although it does work as long as xxx inherits the same
features that are being used in the index keys.
-Marshall
>
>
> Cheers,
>
> -- Richard