Skip to content

Commit d13af64

Browse files
authored
Fix 47746 - Missing properties quickfix does not handle generic parameters (#47790)
* Added test * Added extra test case
1 parent 44e827b commit d13af64

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
////interface Foo<T> {
4+
//// foo(): T;
5+
////}
6+
////[|const x: Foo<string> = {};|]
7+
8+
verify.codeFix({
9+
index: 0,
10+
description: ts.Diagnostics.Add_missing_properties.message,
11+
newRangeContent: `const x: Foo<string> = {
12+
foo: function(): string {
13+
throw new Error("Function not implemented.");
14+
}
15+
};`,
16+
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
////interface Bar {
4+
//// a: number;
5+
////}
6+
////
7+
////interface Foo<T, U> {
8+
//// foo(a: T): U;
9+
////}
10+
////[|const x: Foo<string, Bar> = {};|]
11+
12+
verify.codeFix({
13+
index: 0,
14+
description: ts.Diagnostics.Add_missing_properties.message,
15+
newRangeContent: `const x: Foo<string, Bar> = {
16+
foo: function(a: string): Bar {
17+
throw new Error("Function not implemented.");
18+
}
19+
};`,
20+
});

0 commit comments

Comments
 (0)