language-ext icon indicating copy to clipboard operation
language-ext copied to clipboard

Constructor not found for LanguageExt.LongRange

Open pilotMike opened this issue 10 months ago • 1 comments

Executing LongRange.FromMinMax(50, 99, 1) throws an exception with "The type initializer for LanguageExt.Range`3 threw an exception" with the inner exception being that the constructor wasn't found for LongRange.

IntegerRange works fine.

creating one's own type, ie class MyLongRange(int start, int end, int step) : Range<MyLongRange, TLong, long>(from, to, step) works fine.

pilotMike avatar Apr 06 '24 18:04 pilotMike

I'm assuming this is pre-v5, as v5 range has been refactored into a single Range type -- my advice would be to create your own Range type for the element-type that fails or you could grab the latest code from the v5-transducers branch and copy it into your own project until you're ready to upgrade to v5.

Even though the branch is officially 'alpha', the Range type is super simple and has good unit test coverage - so I'm confident of its soundness.

louthy avatar Apr 06 '24 18:04 louthy