Skip to content

Commit 5741df4

Browse files
committed
Accept new baselines
1 parent e0c3fc6 commit 5741df4

File tree

5 files changed

+18
-21
lines changed

5 files changed

+18
-21
lines changed

tests/baselines/reference/templateLiteralIntersection.types

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type OriginA1 = `${A}`
1818
>OriginA1 : "a"
1919

2020
type OriginA2 = `${MixA}`
21-
>OriginA2 : `${MixA}`
21+
>OriginA2 : "a"
2222

2323
type B = `${typeof a}`
2424
>B : "a"
@@ -32,23 +32,23 @@ type OriginB1 = `${B}`
3232
>OriginB1 : "a"
3333

3434
type OriginB2 = `${MixB}`
35-
>OriginB2 : `${MixB}`
35+
>OriginB2 : "a"
3636

3737
type MixC = { foo: string } & A
3838
>MixC : { foo: string; } & "a"
3939
>foo : string
4040

4141
type OriginC = `${MixC}`
42-
>OriginC : `${MixC}`
42+
>OriginC : "a"
4343

4444
type MixD<T extends string> =
45-
>MixD : `${T & { foo: string; }}`
45+
>MixD : `${T}`
4646

4747
`${T & { foo: string }}`
4848
>foo : string
4949

5050
type OriginD = `${MixD<A & { foo: string }> & { foo: string }}`;
51-
>OriginD : `${`${"a" & { foo: string; } & { foo: string; }}` & { foo: string; }}`
51+
>OriginD : "a"
5252
>foo : string
5353
>foo : string
5454

tests/baselines/reference/templateLiteralIntersection2.errors.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
templateLiteralIntersection2.ts(7,12): error TS2345: Argument of type '"foo/bar"' is not assignable to parameter of type '`${Path}/${Path}`'.
21
templateLiteralIntersection2.ts(20,10): error TS2345: Argument of type '""' is not assignable to parameter of type '`a${string}` & `${string}a`'.
32
Type '""' is not assignable to type '`a${string}`'.
43
templateLiteralIntersection2.ts(22,10): error TS2345: Argument of type '"ab"' is not assignable to parameter of type '`a${string}` & `${string}a`'.
54
Type '"ab"' is not assignable to type '`${string}a`'.
65

76

8-
==== templateLiteralIntersection2.ts (3 errors) ====
7+
==== templateLiteralIntersection2.ts (2 errors) ====
98
type Path = string & { _pathBrand: any };
109

1110
type JoinedPath = `${Path}/${Path}`;
1211

1312
declare function joinedPath(p: JoinedPath): void;
1413

1514
joinedPath("foo/bar");
16-
~~~~~~~~~
17-
!!! error TS2345: Argument of type '"foo/bar"' is not assignable to parameter of type '`${Path}/${Path}`'.
1815

1916
declare const somePath: Path;
2017

tests/baselines/reference/templateLiteralIntersection2.types

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ type Path = string & { _pathBrand: any };
66
>_pathBrand : any
77

88
type JoinedPath = `${Path}/${Path}`;
9-
>JoinedPath : `${Path}/${Path}`
9+
>JoinedPath : `${string}/${string}`
1010

1111
declare function joinedPath(p: JoinedPath): void;
1212
>joinedPath : (p: JoinedPath) => void
13-
>p : `${Path}/${Path}`
13+
>p : `${string}/${string}`
1414

1515
joinedPath("foo/bar");
1616
>joinedPath("foo/bar") : void
17-
>joinedPath : (p: `${Path}/${Path}`) => void
17+
>joinedPath : (p: `${string}/${string}`) => void
1818
>"foo/bar" : "foo/bar"
1919

2020
declare const somePath: Path;
2121
>somePath : Path
2222

2323
joinedPath(`${somePath}/${somePath}`);
2424
>joinedPath(`${somePath}/${somePath}`) : void
25-
>joinedPath : (p: `${Path}/${Path}`) => void
26-
>`${somePath}/${somePath}` : `${Path}/${Path}`
25+
>joinedPath : (p: `${string}/${string}`) => void
26+
>`${somePath}/${somePath}` : `${string}/${string}`
2727
>somePath : Path
2828
>somePath : Path
2929

tests/baselines/reference/templateLiteralIntersection3.types

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ options1[`foo/${path}`] = false;
2424
>options1[`foo/${path}`] = false : false
2525
>options1[`foo/${path}`] : boolean
2626
>options1 : { prop: number; } & { [k: string]: boolean; }
27-
>`foo/${path}` : `foo/${Path}`
27+
>`foo/${path}` : `foo/${string}`
2828
>path : Path
2929
>false : false
3030

3131

3232
// Lowercase<`foo/${Path}`> => `foo/${Lowercase<Path>}`
3333
declare const lowercasePath: Lowercase<`foo/${Path}`>;
34-
>lowercasePath : `foo/${Lowercase<`${Path}`>}`
34+
>lowercasePath : `foo/${Lowercase<string>}`
3535

3636
options1[lowercasePath] = false;
3737
>options1[lowercasePath] = false : false
3838
>options1[lowercasePath] : boolean
3939
>options1 : { prop: number; } & { [k: string]: boolean; }
40-
>lowercasePath : `foo/${Lowercase<`${Path}`>}`
40+
>lowercasePath : `foo/${Lowercase<string>}`
4141
>false : false
4242

tests/baselines/reference/templateLiteralTypesPatterns.types

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -656,20 +656,20 @@ conversionTest2("testDowncast");
656656

657657
function conversionTest3(groupName: | "downcast" | "dataDowncast" | "editingDowncast" | `${string & {}}Downcast`) {}
658658
>conversionTest3 : (groupName: "downcast" | "dataDowncast" | "editingDowncast" | `${string & {}}Downcast`) => void
659-
>groupName : "downcast" | `${string & {}}Downcast`
659+
>groupName : `${string}Downcast` | "downcast"
660660

661661
conversionTest3("testDowncast");
662662
>conversionTest3("testDowncast") : void
663-
>conversionTest3 : (groupName: "downcast" | `${string & {}}Downcast`) => void
663+
>conversionTest3 : (groupName: `${string}Downcast` | "downcast") => void
664664
>"testDowncast" : "testDowncast"
665665

666666
function conversionTest4(groupName: | "downcast" | "dataDowncast" | "editingDowncast" | `${{} & string}Downcast`) {}
667667
>conversionTest4 : (groupName: "downcast" | "dataDowncast" | "editingDowncast" | `${{} & string}Downcast`) => void
668-
>groupName : "downcast" | `${{} & string}Downcast`
668+
>groupName : `${string}Downcast` | "downcast"
669669

670670
conversionTest4("testDowncast");
671671
>conversionTest4("testDowncast") : void
672-
>conversionTest4 : (groupName: "downcast" | `${{} & string}Downcast`) => void
672+
>conversionTest4 : (groupName: `${string}Downcast` | "downcast") => void
673673
>"testDowncast" : "testDowncast"
674674

675675
function foo(str: `${`a${string}` & `${string}a`}Test`) {}

0 commit comments

Comments
 (0)