flatty icon indicating copy to clipboard operation
flatty copied to clipboard

Subrange types unsafely parse

Open beef331 opened this issue 3 years ago • 1 comments

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.

beef331 avatar May 26 '22 23:05 beef331

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.

treeform avatar Jan 18 '24 06:01 treeform