Skip to content

Commit cc7710c

Browse files
committed
Add fourslash tests and update missed baselines
1 parent b9fb4cc commit cc7710c

5 files changed

Lines changed: 81 additions & 14 deletions

File tree

‎tests/baselines/reference/isomorphicMappedTypeInference.js‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -310,17 +310,11 @@ declare type Spec<T> = {
310310
*/
311311
declare function applySpec<T>(obj: Spec<T>): (...args: any[]) => T;
312312
declare var g1: (...args: any[]) => {
313-
sum: number;
314-
nested: {
315-
mul: string;
316-
};
313+
sum: {};
314+
nested: {};
317315
};
318316
declare var g2: (...args: any[]) => {
319-
foo: {
320-
bar: {
321-
baz: boolean;
322-
};
323-
};
317+
foo: {};
324318
};
325319
declare const foo: <T>(object: T, partial: Partial<T>) => T;
326320
declare let o: {

‎tests/baselines/reference/keyofAndIndexedAccess.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ declare var hashOfEmpty1: {
11051105
test: {};
11061106
};
11071107
declare var hashOfEmpty2: {
1108-
test: boolean;
1108+
test: {};
11091109
};
11101110
interface Options1<Data, Computed> {
11111111
data?: Data;

‎tests/baselines/reference/thisTypeInObjectLiterals2.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ declare function defineProps<T, U>(obj: T, descs: PropDescMap<U> & ThisType<T>):
462462
declare let p10: Point & Record<"foo", number>;
463463
declare let p11: Point & Record<"bar", number>;
464464
declare let p12: Point & {
465-
foo: number;
466-
bar: number;
465+
foo: {};
466+
bar: {};
467467
};
468468
declare type Accessors<T> = {
469469
[K in keyof T]: (() => T[K]) | Computed<T[K]>;
@@ -487,6 +487,6 @@ declare let vue: {
487487
} & {
488488
f(x: string): number;
489489
} & {
490-
test: number;
491-
hello: string;
490+
test: {};
491+
hello: {};
492492
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/// <reference path="fourslash.ts" />
2+
// @Filename: test.ts
3+
//// interface A { a: A }
4+
//// declare let a: A;
5+
//// type Deep<T> = { [K in keyof T]: Deep<T[K]> }
6+
//// declare function foo<T>(deep: Deep<T>): T;
7+
//// const out = foo(a);
8+
//// out./*1*/a
9+
//// out.a./*2*/a
10+
//// out.a.a./*3*/a
11+
12+
goTo.marker('1');
13+
verify.completionListCount(1);
14+
goTo.marker('2');
15+
verify.completionListCount(1);
16+
goTo.marker('3');
17+
verify.completionListCount(1);
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/// <reference path="fourslash.ts" />
2+
// @Filename: test.ts
3+
//// interface A { a: A }
4+
//// declare let a: A;
5+
//// type Deep<T> = { [K in keyof T]: Deep<T[K]> }
6+
//// declare function foo<T>(deep: Deep<T>): T;
7+
//// const out/*1*/ = foo/*2*/(a);
8+
//// out.a/*3*/
9+
//// out.a.a/*4*/
10+
//// out.a.a.a.a.a.a.a/*5*/
11+
////
12+
//// interface B { [s: string]: B }
13+
//// declare let b: B;
14+
//// const oub/*6*/ = foo/*7*/(b);
15+
//// oub.b/*8*/
16+
//// oub.b.b/*9*/
17+
//// oub.b.a.n.a.n.a/*10*/
18+
19+
verify.quickInfoAt('1', `const out: {
20+
a: {};
21+
}`);
22+
verify.quickInfoAt('2', `function foo<{
23+
a: {};
24+
}>(deep: Deep<{
25+
a: {};
26+
}>): {
27+
a: {};
28+
}`);
29+
verify.quickInfoAt('3', `(property) a: {
30+
a: {};
31+
}`);
32+
verify.quickInfoAt('4', `(property) a: {
33+
a: {};
34+
}`);
35+
verify.quickInfoAt('5', `(property) a: {
36+
a: {};
37+
}`);
38+
verify.quickInfoAt('6', `const oub: {
39+
[x: string]: {};
40+
}`);
41+
verify.quickInfoAt('7', `function foo<{
42+
[x: string]: {};
43+
}>(deep: Deep<{
44+
[x: string]: {};
45+
}>): {
46+
[x: string]: {};
47+
}`);
48+
verify.quickInfoAt('8', `{
49+
[x: string]: {};
50+
}`);
51+
verify.quickInfoAt('9', `{
52+
[x: string]: {};
53+
}`);
54+
verify.quickInfoAt('10', `{
55+
[x: string]: {};
56+
}`);

0 commit comments

Comments
 (0)