Hello
I'm a big fan of type constraints in type parameters and as far as I'm aware constraints only work for type parameters but is there anything preventing them being available to constrain types elsewhere?
For example, I've got a class with a static field 'Camera', it needs to be of type three.Camera but it also needs to have fields 'near' and 'far'. (Which not all subclasses of three.Camera have)
It feels like the simplest thing to do would be to define the field as:
static var camera:(three.Camera, {near:Float,far:Float}));
which I could of course do if I was using a type parameter, but because it's a static field, I don't believe I can use one
Is there another way of achieving this? Or is it worth putting forward as a feature suggestion?
Thanks,
George