Open
Description
π Search Terms
5.3 regression
π Version & Regression Information
- This changed between versions 5.3.0-dev.20230823 and 5.3.0-dev.20230824
β― Playground Link
π» Code
export { }
interface Map<V> extends Collection<V> {
flatMap<VM>(): Map<VM>;
}
interface Collection<V> {
value: V; // sprinkle some covariance
map: Map<V>;
concat(): Collection<unknown>;
flatMap(): Collection<V>;
flatMap<VM>(): Collection<VM>;
}
// Comment out and it works like in 5.2
interface Keyed extends Collection<number> {
concat(): Keyed;
}
type R = Map<never> extends Collection<infer V> ? V : "NO";
const r = null! as R;
const t: "NO" = r;
π Actual behavior
R is unknown
. Removing Keyed
makes R
"NO"
, even though Keyed
is unused otherwise.
π Expected behavior
Not really sure. I'd settle for the stable 5.2 behavior, which is for R
to be "NO"
although that also seems wrong (Why doesn't Map<never> extends Collection
? If we remove flatMap(): Collection<V>
from Collection
then Map<never>
extends Collection
. This seems like the correct behavior.)
Additional information about the issue
No response