Closed kjetilk closed 5 years ago
I'm not familiar with this approach, but it seems pretty straightforward. Do you think there are any downsides to this? If not, I'm happy to merge it.
I'm not aware of downsides. I suppose the code path becomes more complex and so it could be slower, but it seems to be the Right Way to do it from a typing perspective.
It seems like we should use something like this whereever we say InstanceOf
.
While thinking about coercions, I started to think about the type system, and then figured it might be appropriate to use the types already there. Please have a look to see if this makes sense.