BREAKING: Lucene.Net.Util.Fst: Added class constraint on all generics #581
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reverts
Lucene.Net.Util.Fst
to be more like the original design, using reference types as the generic closing type for generic classes and methods. It reverts to the original reference equality checking that Lucene uses. It also adds a class constraint on all of the generic types to enforce this, as using value types is incompatible with the reference equality checks.The original design of FST uses reference equality to compare output values. There are also extensions to FST in
Lucene.Net.Misc
that declare the generic type asobject
so either a long integer type or another reference type can be returned.This had been changed to use
long?
as the generic closing type and the reference equality checking was changed to value equality checking. This of course meant that boxing would take place in theLucene.Net.Misc
extensions and also made it impossible to uselong
instead oflong?
as the generic closing type because of how equality was being compared, which made the API confusing to use.This PR also adds a
MoveNext()
method to theLucene.Net.Util.Fst.Int32sRefFSTEnum
and deprecates theNext()
method (see #279).