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: 'addMissingPropertyDefiniteAssignmentAssertions',
|
2018-03-28 03:21:21 +02:00
|
|
|
fixAllDescription: "Add definite assignment assertions 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;
|
|
|
|
|
|
|
|
static b: string;
|
|
|
|
|
|
|
|
private c!: string;
|
|
|
|
|
|
|
|
d: number | undefined;
|
|
|
|
|
|
|
|
e!: string | number;
|
|
|
|
|
|
|
|
f!: 1;
|
|
|
|
|
|
|
|
g!: "123" | "456";
|
|
|
|
|
|
|
|
h!: boolean;
|
|
|
|
|
|
|
|
i!: TT;
|
|
|
|
|
|
|
|
j!: A;
|
|
|
|
|
|
|
|
k!: AT;
|
|
|
|
|
|
|
|
l!: Foo;
|
|
|
|
}`
|
|
|
|
});
|