-
Notifications
You must be signed in to change notification settings - Fork 38
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
not operator (anything but) #139
Comments
I like it. |
After thinking about it I think that introducing a new keyword is not a good idea: we should be as JS compatible as possible. It's not ruby after all. Ill do a PR if I find an acceptable title for the chapter. Still Iv got a problem:
Ill have to poke #132 in this PR. |
I'm not sure what you mean by this. JavaScript has a logical ! operator which behaves similarly. // if & is introduced
!(A | B)
// could be expanded to
!A | !B
// which is not
!A & !B I don't see this as a problem, as long as it is well documented. |
My biggest problem with this proposal is that |
I was talking about
Do you have an example in mind? |
That's to be expected. Let's say you had |
tl;dr:
Sometimes it's way easier and convenient to define the type by discarding one or several.
There's also the possibility to define it as a substraction—e.g.
Any - String
—but that would not be very conventional.TypeScript approaches
The text was updated successfully, but these errors were encountered: