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
{{ message }}
Repository navigation
This condition will always return 'false' (2367) error no longer appears on template literal types with keyword typesΒ #45201
declareconstfoo: `foo${number}`
foo==='bar'// no error even though types are incompatibleconstbar: `foo${number}` ='bar'//error: Type '"bar"' is not assignable to type '`foo${number}`'
π Actual behavior
no error when comparing the incompatible types
π Expected behavior
the same error that occurs when you do the same thing in typescript <=4.2.3
This condition will always return 'false' since the types '`foo${number}`' and '"bar"' have no overlap.(2367)
Activity
DetachHead commentedon Oct 2, 2021
looks like this is fixed in 4.5 https://www.typescriptlang.org/play?ts=4.5.0-dev.20211002#code/CYUwxgNghgTiAEYD2A7AzgF3gMyUgXPAAa5IAkA3igK4C2ARiDAL5EBQp8AvD-AOT1YfeAHoR8JjCQx4+AJRs2ydFkExCJPJRoMmrbvzXCxk6YQAqATwAOCPgCI194QEs08FEixQ0aFwHMUKHoIBAwkeAwbO01yKjpGFiI+IA