2018-10-09 19:38:46 +02:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
// @allowJs: true
|
|
|
|
// @checkJs: true
|
|
|
|
// @noImplicitAny: true
|
|
|
|
// @Filename: important.js
|
|
|
|
////class C {
|
|
|
|
//// set [|x(v)|] {
|
|
|
|
//// v;
|
|
|
|
//// }
|
|
|
|
////}
|
|
|
|
////(new C).x = 1;
|
|
|
|
|
2018-10-25 00:34:15 +02:00
|
|
|
verify.codeFix({
|
|
|
|
description: "Infer type of \'x\' from usage",
|
2018-11-02 23:39:27 +01:00
|
|
|
index: 0,
|
2018-10-25 00:34:15 +02:00
|
|
|
newFileContent:
|
|
|
|
`class C {
|
2018-10-09 19:38:46 +02:00
|
|
|
/**
|
|
|
|
* @param {number} v
|
|
|
|
*/
|
|
|
|
set x(v) {
|
|
|
|
v;
|
|
|
|
}
|
|
|
|
}
|
2018-10-25 00:34:15 +02:00
|
|
|
(new C).x = 1;`,
|
|
|
|
});
|