No narrowing on assert.strictEqual() #48244
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
Bug Report
assert.strictEqual(a, b)
andassert.equal(a, b)
does not result in typescript narrowing likeassert(a === b)
🔎 Search Terms
assert, assert.equal, equal, narrowing
🕗 Version & Regression Information
Always (I assume)
Original feature implemented in #8010
⏯ Playground Link
https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgZxlYBjeBDZdfICmscAvnAGZQQhwDkBxMdAUCzAJ5iFwCCcAXkQs4ouJ24AuetlZi4AO2kKAriABGxFqTYSeAIUHD5e6XXVyxyaanQKA5traEAHpBIUVCrMAgLKAIwAFC5w0vwAPnD6AJTGYoywIQB0eoICQgx0MSJiGH7IEAA2hMlFEPYpCnFwAPS1cADyANJOLK7u8J7eML7+FABMIWF8cFGx8aKJMMm2mDAAogCOKthFKXoANDLZuaL5CoUlZRVVcfVwAGK8AJIAMtIACtTcsBz0CnRwACYQhHgKCDwVzAVBwPziLg8OiRaJ0ZJwZ4QV6cD5fX7-RRAuAgsEQtJ0fTwpxAA
💻 Code
🙁 Actual behavior
No typescript narrowing in function
f2()
🙂 Expected behavior
Typescript narrowing in function
f2()
since it is equavalent tof1()
The text was updated successfully, but these errors were encountered: