Closed
Description
Bug Report
π Search Terms
intersection template literals
π Version & Regression Information
- This changed between versions 5.0 and nightly
β― Playground Link
π» Code
type MaybeCat = `c${string}` & `${string}t`;
type MaybeScats = `s${MaybeCat}s`;
declare var x: MaybeScats;
x = "scats"; // should be OK
x = "scas"; // should error
π Actual behavior
In 5.0, neither error, even though the second one should.
In nightly, after #52836, both error.
π Expected behavior
First one is okay, second is an error.
Noted in: #53406 (review)
Unsure if this is a regression per-se; neither behavior is really right, I just managed to change it and expose what I believe is a new bug to do with how we handle template literals.