2019-01-16 22:51:57 +01:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
// @allowJs: true
|
|
|
|
// @checkJs: true
|
|
|
|
// @noEmit: true
|
|
|
|
// @noImplicitAny: true
|
|
|
|
// @Filename: test.js
|
|
|
|
|
|
|
|
////const foo = x => x.y + 1;
|
2019-01-26 16:59:32 +01:00
|
|
|
////class C {
|
|
|
|
//// m = x => x.y + 1;
|
|
|
|
////}
|
2019-01-16 22:51:57 +01:00
|
|
|
|
2019-01-26 16:59:32 +01:00
|
|
|
verify.codeFixAll({
|
|
|
|
fixId: "inferFromUsage",
|
|
|
|
fixAllDescription: "Infer all types from usage",
|
2019-01-16 22:51:57 +01:00
|
|
|
newFileContent:
|
|
|
|
`/**
|
|
|
|
* @param {{ y: number; }} x
|
|
|
|
*/
|
2019-01-26 16:59:32 +01:00
|
|
|
const foo = x => x.y + 1;
|
|
|
|
class C {
|
|
|
|
/**
|
|
|
|
* @param {{ y: number; }} x
|
|
|
|
*/
|
|
|
|
m = x => x.y + 1;
|
|
|
|
}`,
|
2019-01-16 22:51:57 +01:00
|
|
|
});
|