mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Fixed an issue with string mappings over generic intersections not being deferred in conditional types (#55856)
This commit is contained in:
committed by
GitHub
parent
aa9b695344
commit
41ebfbf0aa
@@ -0,0 +1,21 @@
|
||||
// @strict: true
|
||||
// @noEmit: true
|
||||
|
||||
// https://github.com/microsoft/TypeScript/issues/55847
|
||||
|
||||
type A<S> = Lowercase<S & string> extends "foo" ? 1 : 0;
|
||||
let x1: A<"foo"> = 1; // ok
|
||||
|
||||
type B<S> = Lowercase<S & string> extends `f${string}` ? 1 : 0;
|
||||
let x2: B<"foo"> = 1; // ok
|
||||
|
||||
type C<S> = Capitalize<Lowercase<S & string>> extends "Foo" ? 1 : 0;
|
||||
let x3: C<"foo"> = 1; // ok
|
||||
|
||||
type D<S extends string> = Capitalize<Lowercase<S>> extends "Foo" ? 1 : 0;
|
||||
let x4: D<"foo"> = 1; // ok
|
||||
|
||||
type E<S> = Lowercase<`f${S & string}` & `${S & string}f`>;
|
||||
type F = E<""> extends "f" ? 1 : 0; // 1
|
||||
type G<S> = E<S> extends "f" ? 1 : 0;
|
||||
let x5: G<""> = 1; // ok
|
||||
Reference in New Issue
Block a user