type TPoint=distinct tuple[x,y:float]
var pt:TPoint
pt.x=10.0
Generates an Error: undeclared field: 'x' on line 3 , this does not happen if TPoint is not distinct., why is that?
Looks problematic. The following code works for me:
type
APoint = tuple[x, y: float]
TPoint= distinct APoint
var pt:APoint
pt = (10.0, 10.0)
Then, when I change the type of pt to TPoint it stops compiling with:
dist.nim(5, 6) Error: type mismatch: got (tuple[float, float]) but expected 'TPoint'
Writing pt = TPoint(10.0, 10.0) doesn't help either.