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
leta: string|undefinedletb: string|undefinedletc: string|undefinedconstaf=()=>{thrownewError()}constbf=(): never=>{thrownewError()}constcf: ()=>never=()=>{thrownewError()}if(!a)af();a.length// Errorif(!b)bf();b.length// Errorif(!c)cf();c.length// Fine
π Actual behavior
Typescript does not check 'never' in condition statements but does if the whole function is declared
π Expected behavior
The 'never' return type should always behave in the same way
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered:
π Search Terms
Never, return type never
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?#code/DYUwLgBAhgXBDOYBOBLAdgcwgHwgVzQBMQAzdEQgKFEgCM5FVMd8jTyqaIBjB5dLLgLEyaCpUrcA9mkTQSEALwQAFAEolAPggBvShAMQwACyRSA7hDGWAokjNJ1lAL6SZc2guXq4YgG4gSFq6+oYmZpbWEHYOTq7SspDcJHDqwf6BSqoaitp6hkamFlYgtvZSjmouEmAAngAOIEYgiACCAGJZAErgeEhoACoNIAA8dY1SClAkmpQA9HOGAHoA-JTjTWAtYABCnco9YH2Dw2PDkxCeswvLaxvNiADC+xCHx0ONZxMKydeLBqsJJQUAoVABCKAaabqADclCgADpQJgTBIQaowbQNJ5YZRaEiQCjjBA0aCwdwNMlcdwCUSIEA
π» Code
π Actual behavior
Typescript does not check 'never' in condition statements but does if the whole function is declared
π Expected behavior
The 'never' return type should always behave in the same way
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: