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
constfoo: [Date|undefined,Date|undefined]=[undefined,newDate()]conststrictDatePair=(dates: [Date,Date])=>console.log(dates)if(foo[0]instanceofDate&&foo[1]instanceofDate){strictDatePair([foo[0],foo[1]])// ok}if(foo[0]instanceofDate&&foo[1]instanceofDate){strictDatePair(foo)// error TS2345: Argument of type '[Date | undefined, Date | undefined]' is not assignable to parameter of type '[Date, Date]'.}
Expected behavior:
If item is narrowed to a specific type it should be reflected in array
TypeScript Version: 3.6.0-dev.20190730
Search Terms:
Code
Expected behavior:
If item is narrowed to a specific type it should be reflected in array
Actual behavior:
It's only related to individual item
Playground Link: https://www.typescriptlang.org/play/index.html#code/MYewdgzgLgBAZiEAuGBtAIgQygUxgHxgFcwATHOASzB1IBoYtcDiyLraBdGAXjRPJUa9GDQDujbDgAUASk4AoBaEixoAJ0rAoTHAAVMldbxjTSUiCgxSGuzrN4A+GCoggANjgB07kAHMzC1klSjhpBBBUAAZuamhMMGAcEDhJZgAydPhEVABGWNUEpJS0nAcAbwUYapgNLR0pAyNpVAjozgY2-PsFAF8QsLaYmDioIuTU3RhM7Mj8kcLEidKKqpq67V0m9XDEYN6gA
Related Issues: No
The text was updated successfully, but these errors were encountered: