-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate unidirectional assignability #39
Comments
We could either expose a new assertion type, which has the same behaviour as the old expectTypeLoose<Color>('red');
expectType<Color>('red', false); Second parameter is a boolean indicating if the assertion is strict or not. I think I'm slightly more in favour of a separate assertion as the intention is much clearer. |
Instead of |
I like that... |
I like |
I believe a |
Agreed |
When I was in the shower this morning, I figured out how I could easily add the |
Since 0.9.0,
expectType
assertions are strict. Buy maybe this isn't always what we want.This will fail because
Color
is not assignable tored
unless you explicitly cast it to Color.Should we add a loose (or unidirectional)
expectType
variant for these cases?The text was updated successfully, but these errors were encountered: