Skip to content

Commit dd29423

Browse files
committed
Create a few (failing) test cases of microsoft#58449
1 parent d06fb82 commit dd29423

2 files changed

+36
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/// <reference path='fourslash.ts'/>
2+
3+
// @isolatedDeclarations: true
4+
// @declaration: true
5+
// @file lib.d.ts
6+
////interface MyIterator<T, TReturn = any, TNext = undefined> {}
7+
////let x: MyIterator<number>;
8+
////export const y = x;
9+
10+
verify.codeFix({
11+
description: "Add annotation of type 'MyIterator<number>'",
12+
index: 0,
13+
newFileContent:
14+
`interface MyIterator<T, TReturn = any, TNext = undefined> {}
15+
let x: MyIterator<number>;
16+
export const y: MyIterator<number> = x;`,
17+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/// <reference path='fourslash.ts'/>
2+
3+
// @isolatedDeclarations: true
4+
// @declaration: true
5+
6+
////export interface Foo<T, U = T[]> {}
7+
////export function foo(x: Foo<string>) {
8+
//// return x;
9+
////}
10+
11+
verify.codeFix({
12+
description: "Add return type 'Foo<string>'",
13+
index: 0,
14+
newFileContent:
15+
`export interface Foo<T, U = T[]> {}
16+
export function foo(x: Foo<string>): Foo<string> {
17+
return x;
18+
}`,
19+
});

0 commit comments

Comments
 (0)