Replies: 1 comment 3 replies
-
|
This would be distinct from the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
A lot of times, you can have a super-type that can be downcast to a sub-type if the right conditions are met. Some examples include:
nSomething as strong as example 5, or really this entire proposal, should not be considered lightly though, since it may introduce type soundness errors. We may think these potential problems, like an Embeddable impl not properly verifying what it's supposed to, can be counted as user error and thus not a soundness error; Rust does this with the
PartialEqfamily of traits, thePartialOrdfamily, andHash. Some other problems that I don't know of, we might not be able to wave off to user-land. Any TypeScript-inspired feature like this one should be looked at with a bit of scrutiny, since TS is known to be an unsound type system.Beta Was this translation helpful? Give feedback.
All reactions