Skip to content

Commit 2cd6752

Browse files
committed
Remove lib change
1 parent d776087 commit 2cd6752

5 files changed

+107
-137
lines changed

src/harness/fourslash.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4672,7 +4672,7 @@ namespace FourSlashInterface {
46724672
typeEntry("ReturnType"),
46734673
typeEntry("InstanceType"),
46744674
interfaceEntry("ThisType"),
4675-
typeEntry("Tag"),
4675+
// typeEntry("Tag"),
46764676
varEntry("ArrayBuffer"),
46774677
interfaceEntry("ArrayBufferTypes"),
46784678
typeEntry("ArrayBufferLike"),

src/lib/es5.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1481,9 +1481,9 @@ interface ThisType<T> { }
14811481
/**
14821482
* Constructs a structural tag over property name(s) `K`
14831483
*/
1484-
type Tag<K extends keyof any> = tag {
1485-
[_ in K]: void;
1486-
};
1484+
// type Tag<K extends keyof any> = tag {
1485+
// [_ in K]: void;
1486+
// };
14871487

14881488
/**
14891489
* Represents a raw buffer of binary data, which is used to store data for the
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1-
tests/cases/conformance/types/structuralTags/structuralTagTypesUsingGlobalTagAlias.ts(53,29): error TS2345: Argument of type '"/a/b/c" & Tag<"NormalizedPath">' is not assignable to parameter of type 'AbsolutePath'.
2-
Type '"/a/b/c" & Tag<"NormalizedPath">' is not assignable to type 'Tag<"AbsolutePath">'.
3-
tests/cases/conformance/types/structuralTags/structuralTagTypesUsingGlobalTagAlias.ts(55,39): error TS2345: Argument of type '"/a/b/c" & Tag<"NormalizedPath">' is not assignable to parameter of type 'NormalizedAbsolutePath'.
4-
Type '"/a/b/c" & Tag<"NormalizedPath">' is not assignable to type 'Tag<"NormalizedPath"> & Tag<"AbsolutePath">'.
5-
tests/cases/conformance/types/structuralTags/structuralTagTypesUsingGlobalTagAlias.ts(60,31): error TS2345: Argument of type '"/a/b/c" & Tag<"AbsolutePath">' is not assignable to parameter of type 'NormalizedPath'.
6-
Type '"/a/b/c" & Tag<"AbsolutePath">' is not assignable to type 'Tag<"NormalizedPath">'.
7-
tests/cases/conformance/types/structuralTags/structuralTagTypesUsingGlobalTagAlias.ts(63,39): error TS2345: Argument of type '"/a/b/c" & Tag<"AbsolutePath">' is not assignable to parameter of type 'NormalizedAbsolutePath'.
8-
Type '"/a/b/c" & Tag<"AbsolutePath">' is not assignable to type 'Tag<"NormalizedPath"> & Tag<"AbsolutePath">'.
9-
tests/cases/conformance/types/structuralTags/structuralTagTypesUsingGlobalTagAlias.ts(66,31): error TS2345: Argument of type '"/a/b/c"' is not assignable to parameter of type 'NormalizedPath'.
10-
Type '"/a/b/c"' is not assignable to type 'Tag<"NormalizedPath">'.
11-
tests/cases/conformance/types/structuralTags/structuralTagTypesUsingGlobalTagAlias.ts(67,29): error TS2345: Argument of type '"/a/b/c"' is not assignable to parameter of type 'AbsolutePath'.
12-
Type '"/a/b/c"' is not assignable to type 'Tag<"AbsolutePath">'.
13-
tests/cases/conformance/types/structuralTags/structuralTagTypesUsingGlobalTagAlias.ts(68,41): error TS2345: Argument of type '"/a/b/c"' is not assignable to parameter of type 'NormalizedPath | AbsolutePath'.
14-
tests/cases/conformance/types/structuralTags/structuralTagTypesUsingGlobalTagAlias.ts(69,39): error TS2345: Argument of type '"/a/b/c"' is not assignable to parameter of type 'NormalizedAbsolutePath'.
15-
Type '"/a/b/c"' is not assignable to type 'Tag<"NormalizedPath"> & Tag<"AbsolutePath">'.
1+
tests/cases/conformance/types/structuralTags/structuralTagTypesUsingGlobalTagAlias.ts(2,17): error TS2304: Cannot find name 'Tag'.
2+
tests/cases/conformance/types/structuralTags/structuralTagTypesUsingGlobalTagAlias.ts(3,17): error TS2304: Cannot find name 'Tag'.
3+
tests/cases/conformance/types/structuralTags/structuralTagTypesUsingGlobalTagAlias.ts(31,32): error TS2304: Cannot find name 'Tag'.
4+
tests/cases/conformance/types/structuralTags/structuralTagTypesUsingGlobalTagAlias.ts(32,30): error TS2304: Cannot find name 'Tag'.
165

176

18-
==== tests/cases/conformance/types/structuralTags/structuralTagTypesUsingGlobalTagAlias.ts (8 errors) ====
7+
==== tests/cases/conformance/types/structuralTags/structuralTagTypesUsingGlobalTagAlias.ts (4 errors) ====
198
export type Paired = {
209
x: number & Tag<"x">;
10+
~~~
11+
!!! error TS2304: Cannot find name 'Tag'.
2112
y: number & Tag<"y">;
13+
~~~
14+
!!! error TS2304: Cannot find name 'Tag'.
2215
};
2316

2417

@@ -47,7 +40,11 @@ tests/cases/conformance/types/structuralTags/structuralTagTypesUsingGlobalTagAli
4740

4841

4942
type NormalizedPath = string & Tag<"NormalizedPath">;
43+
~~~
44+
!!! error TS2304: Cannot find name 'Tag'.
5045
type AbsolutePath = string & Tag<"AbsolutePath">;
46+
~~~
47+
!!! error TS2304: Cannot find name 'Tag'.
5148
type NormalizedAbsolutePath = NormalizedPath & AbsolutePath;
5249

5350
declare function isNormalizedPath(x: string): x is NormalizedPath;
@@ -69,45 +66,22 @@ tests/cases/conformance/types/structuralTags/structuralTagTypesUsingGlobalTagAli
6966
else {
7067
consumeNormalizedPath(p);
7168
consumeAbsolutePath(p); // err
72-
~
73-
!!! error TS2345: Argument of type '"/a/b/c" & Tag<"NormalizedPath">' is not assignable to parameter of type 'AbsolutePath'.
74-
!!! error TS2345: Type '"/a/b/c" & Tag<"NormalizedPath">' is not assignable to type 'Tag<"AbsolutePath">'.
7569
consumeNormalizedOrAbsolutePath(p);
7670
consumeNormalizedAbsolutePath(p); // err
77-
~
78-
!!! error TS2345: Argument of type '"/a/b/c" & Tag<"NormalizedPath">' is not assignable to parameter of type 'NormalizedAbsolutePath'.
79-
!!! error TS2345: Type '"/a/b/c" & Tag<"NormalizedPath">' is not assignable to type 'Tag<"NormalizedPath"> & Tag<"AbsolutePath">'.
8071
}
8172
}
8273
else {
8374
if (isAbsolutePath(p)) {
8475
consumeNormalizedPath(p); // err
85-
~
86-
!!! error TS2345: Argument of type '"/a/b/c" & Tag<"AbsolutePath">' is not assignable to parameter of type 'NormalizedPath'.
87-
!!! error TS2345: Type '"/a/b/c" & Tag<"AbsolutePath">' is not assignable to type 'Tag<"NormalizedPath">'.
8876
consumeAbsolutePath(p);
8977
consumeNormalizedOrAbsolutePath(p);
9078
consumeNormalizedAbsolutePath(p); // err
91-
~
92-
!!! error TS2345: Argument of type '"/a/b/c" & Tag<"AbsolutePath">' is not assignable to parameter of type 'NormalizedAbsolutePath'.
93-
!!! error TS2345: Type '"/a/b/c" & Tag<"AbsolutePath">' is not assignable to type 'Tag<"NormalizedPath"> & Tag<"AbsolutePath">'.
9479
}
9580
else {
9681
consumeNormalizedPath(p); // err
97-
~
98-
!!! error TS2345: Argument of type '"/a/b/c"' is not assignable to parameter of type 'NormalizedPath'.
99-
!!! error TS2345: Type '"/a/b/c"' is not assignable to type 'Tag<"NormalizedPath">'.
10082
consumeAbsolutePath(p); // err
101-
~
102-
!!! error TS2345: Argument of type '"/a/b/c"' is not assignable to parameter of type 'AbsolutePath'.
103-
!!! error TS2345: Type '"/a/b/c"' is not assignable to type 'Tag<"AbsolutePath">'.
10483
consumeNormalizedOrAbsolutePath(p); // err
105-
~
106-
!!! error TS2345: Argument of type '"/a/b/c"' is not assignable to parameter of type 'NormalizedPath | AbsolutePath'.
10784
consumeNormalizedAbsolutePath(p); // err
108-
~
109-
!!! error TS2345: Argument of type '"/a/b/c"' is not assignable to parameter of type 'NormalizedAbsolutePath'.
110-
!!! error TS2345: Type '"/a/b/c"' is not assignable to type 'Tag<"NormalizedPath"> & Tag<"AbsolutePath">'.
11185
}
11286
}
11387

tests/baselines/reference/structuralTagTypesUsingGlobalTagAlias.symbols

+8-12
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ export type Paired = {
44

55
x: number & Tag<"x">;
66
>x : Symbol(x, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 0, 22))
7-
>Tag : Symbol(Tag, Decl(lib.es5.d.ts, --, --))
87

98
y: number & Tag<"y">;
109
>y : Symbol(y, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 1, 25))
11-
>Tag : Symbol(Tag, Decl(lib.es5.d.ts, --, --))
1210

1311
};
1412

@@ -72,17 +70,17 @@ if (isPaired(b)) {
7270
>b : Symbol(b, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 15, 5))
7371

7472
b.x = a.x;
75-
>b.x : Symbol(x, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 0, 22))
73+
>b.x : Symbol(x, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 15, 11))
7674
>b : Symbol(b, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 15, 5))
77-
>x : Symbol(x, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 0, 22))
75+
>x : Symbol(x, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 15, 11))
7876
>a.x : Symbol(x, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 0, 22))
7977
>a : Symbol(a, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 14, 5))
8078
>x : Symbol(x, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 0, 22))
8179

8280
b.y = a.y;
83-
>b.y : Symbol(y, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 1, 25))
81+
>b.y : Symbol(y, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 15, 16))
8482
>b : Symbol(b, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 15, 5))
85-
>y : Symbol(y, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 1, 25))
83+
>y : Symbol(y, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 15, 16))
8684
>a.y : Symbol(y, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 1, 25))
8785
>a : Symbol(a, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 14, 5))
8886
>y : Symbol(y, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 1, 25))
@@ -91,27 +89,25 @@ if (isPaired(b)) {
9189
>a.x : Symbol(x, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 0, 22))
9290
>a : Symbol(a, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 14, 5))
9391
>x : Symbol(x, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 0, 22))
94-
>b.x : Symbol(x, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 0, 22))
92+
>b.x : Symbol(x, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 15, 11))
9593
>b : Symbol(b, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 15, 5))
96-
>x : Symbol(x, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 0, 22))
94+
>x : Symbol(x, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 15, 11))
9795

9896
a.y = b.y;
9997
>a.y : Symbol(y, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 1, 25))
10098
>a : Symbol(a, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 14, 5))
10199
>y : Symbol(y, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 1, 25))
102-
>b.y : Symbol(y, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 1, 25))
100+
>b.y : Symbol(y, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 15, 16))
103101
>b : Symbol(b, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 15, 5))
104-
>y : Symbol(y, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 1, 25))
102+
>y : Symbol(y, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 15, 16))
105103
}
106104

107105

108106
type NormalizedPath = string & Tag<"NormalizedPath">;
109107
>NormalizedPath : Symbol(NormalizedPath, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 27, 1))
110-
>Tag : Symbol(Tag, Decl(lib.es5.d.ts, --, --))
111108

112109
type AbsolutePath = string & Tag<"AbsolutePath">;
113110
>AbsolutePath : Symbol(AbsolutePath, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 30, 53))
114-
>Tag : Symbol(Tag, Decl(lib.es5.d.ts, --, --))
115111

116112
type NormalizedAbsolutePath = NormalizedPath & AbsolutePath;
117113
>NormalizedAbsolutePath : Symbol(NormalizedAbsolutePath, Decl(structuralTagTypesUsingGlobalTagAlias.ts, 31, 49))

0 commit comments

Comments
 (0)