Test that type parameters used in constraints are passed along

This commit is contained in:
Andrew Casey
2017-08-16 16:54:57 -07:00
parent fe015ef30f
commit 0c8d85fbc4
2 changed files with 43 additions and 1 deletions

View File

@@ -574,6 +574,13 @@ namespace A {
[#|t1.toString();
t2.toString();|]
}
}`);
// Confirm that the constraint is preserved.
testExtractMethod("extractMethod15",
`function F<T>(t1: T) {
function F<U extends T[]>(t2: U) {
[#|t2.toString();|]
}
}`);
});
@@ -590,7 +597,7 @@ namespace A {
path: "/a.ts",
content: t.source
};
const host = projectSystem.createServerHost([f]);
const host = projectSystem.createServerHost([f, projectSystem.libFile]);
const projectService = projectSystem.createProjectService(host);
projectService.openClientFile(f.path);
const program = projectService.inferredProjects[0].getLanguageService().getProgram();