Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 47746 - Missing properties quickfix does not handle generic param…
…eters (#47790) * Added test * Added extra test case
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
////interface Foo<T> { | ||
//// foo(): T; | ||
////} | ||
////[|const x: Foo<string> = {};|] | ||
|
||
verify.codeFix({ | ||
index: 0, | ||
description: ts.Diagnostics.Add_missing_properties.message, | ||
newRangeContent: `const x: Foo<string> = { | ||
foo: function(): string { | ||
throw new Error("Function not implemented."); | ||
} | ||
};`, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
////interface Bar { | ||
//// a: number; | ||
////} | ||
//// | ||
////interface Foo<T, U> { | ||
//// foo(a: T): U; | ||
////} | ||
////[|const x: Foo<string, Bar> = {};|] | ||
|
||
verify.codeFix({ | ||
index: 0, | ||
description: ts.Diagnostics.Add_missing_properties.message, | ||
newRangeContent: `const x: Foo<string, Bar> = { | ||
foo: function(a: string): Bar { | ||
throw new Error("Function not implemented."); | ||
} | ||
};`, | ||
}); |