2018-02-23 16:25:50 +01:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
// @strict: true
|
|
|
|
|
|
|
|
//// abstract class A { abstract a (); }
|
|
|
|
////
|
|
|
|
//// class TT { constructor () {} }
|
|
|
|
////
|
|
|
|
//// class AT extends A { a () {} }
|
2018-03-28 03:21:21 +02:00
|
|
|
////
|
2018-02-23 16:25:50 +01:00
|
|
|
//// class Foo {}
|
|
|
|
////
|
|
|
|
//// class T {
|
2018-03-28 03:21:21 +02:00
|
|
|
////
|
2018-02-23 16:25:50 +01:00
|
|
|
//// a: string;
|
2018-03-28 03:21:21 +02:00
|
|
|
////
|
2018-02-23 16:25:50 +01:00
|
|
|
//// static b: string;
|
2018-03-28 03:21:21 +02:00
|
|
|
////
|
2018-02-23 16:25:50 +01:00
|
|
|
//// private c: string;
|
2018-03-28 03:21:21 +02:00
|
|
|
////
|
2018-02-23 16:25:50 +01:00
|
|
|
//// d: number | undefined;
|
2018-03-28 03:21:21 +02:00
|
|
|
////
|
2018-02-23 16:25:50 +01:00
|
|
|
//// e: string | number;
|
2018-03-28 03:21:21 +02:00
|
|
|
////
|
2018-02-23 16:25:50 +01:00
|
|
|
//// f: 1;
|
2018-03-28 03:21:21 +02:00
|
|
|
////
|
2018-02-23 16:25:50 +01:00
|
|
|
//// g: "123" | "456";
|
2018-03-28 03:21:21 +02:00
|
|
|
////
|
2018-02-23 16:25:50 +01:00
|
|
|
//// h: boolean;
|
2018-03-28 03:21:21 +02:00
|
|
|
////
|
2018-02-23 16:25:50 +01:00
|
|
|
//// i: TT;
|
2018-03-28 03:21:21 +02:00
|
|
|
////
|
2018-02-23 16:25:50 +01:00
|
|
|
//// j: A;
|
2018-03-28 03:21:21 +02:00
|
|
|
////
|
2018-02-23 16:25:50 +01:00
|
|
|
//// k: AT;
|
2018-03-28 03:21:21 +02:00
|
|
|
////
|
2018-02-23 16:25:50 +01:00
|
|
|
//// l: Foo;
|
|
|
|
//// }
|
|
|
|
|
|
|
|
verify.codeFixAll({
|
|
|
|
fixId: 'addMissingPropertyUndefinedType',
|
2018-03-28 03:21:21 +02:00
|
|
|
fixAllDescription: "Add undefined type to all uninitialized properties",
|
2018-02-23 16:25:50 +01:00
|
|
|
newFileContent: `abstract class A { abstract a (); }
|
|
|
|
|
|
|
|
class TT { constructor () {} }
|
|
|
|
|
|
|
|
class AT extends A { a () {} }
|
|
|
|
|
|
|
|
class Foo {}
|
|
|
|
|
|
|
|
class T {
|
|
|
|
|
|
|
|
a: string | undefined;
|
|
|
|
|
|
|
|
static b: string;
|
|
|
|
|
|
|
|
private c: string | undefined;
|
|
|
|
|
|
|
|
d: number | undefined;
|
|
|
|
|
|
|
|
e: string | number | undefined;
|
|
|
|
|
|
|
|
f: 1 | undefined;
|
|
|
|
|
|
|
|
g: "123" | "456" | undefined;
|
|
|
|
|
|
|
|
h: boolean | undefined;
|
|
|
|
|
|
|
|
i: TT | undefined;
|
|
|
|
|
|
|
|
j: A | undefined;
|
|
|
|
|
|
|
|
k: AT | undefined;
|
|
|
|
|
|
|
|
l: Foo | undefined;
|
|
|
|
}`
|
|
|
|
});
|