You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so I was expecting an error, but no, it compiles fine. Also test("a"); compiles fine. I didn't get the reason why, I've asked on gitter and it looks like this code should give a compile error.
Expected behavior: I think a compiler error should be shown, but I'm really new with TypeScript, so it might easily be an error on my side
Actual behavior: No compiler error, both with test("") and test("a")
The text was updated successfully, but these errors were encountered:
TypeScript Version: 2.8.0-dev.20180322
Code
I am experimenting with the
Exclude
type introduced here #21847.What I would like is to create a type that includes all strings except for "", I thought something like this would work:
so I was expecting an error, but no, it compiles fine. Also
test("a");
compiles fine. I didn't get the reason why, I've asked on gitter and it looks like this code should give a compile error.Expected behavior: I think a compiler error should be shown, but I'm really new with TypeScript, so it might easily be an error on my side
Actual behavior: No compiler error, both with
test("")
andtest("a")
The text was updated successfully, but these errors were encountered: