flatty
flatty copied to clipboard
Subrange types unsafely parse
With stock Flatty using a subrange type will ignore ranges on parse resulting in invalid values.
import flatty
type MyType = object
a: 0..3
var str = 10.toFlatty()
echo str.fromFlatty(MyType) # Expect a Flatty exception that the value is not in the range, instead of working.
I spent several hours to make ranges work, but I just get very strange and puzzling errors.
I think its some sort of compiler bugs that prevent ranges from working.