2016-10-28 20:57:30 +02:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
2017-12-07 21:14:18 +01:00
|
|
|
////// Referenced throughout the inheritance chain.
|
|
|
|
////interface I0 { a: number }
|
|
|
|
////
|
|
|
|
////class C1 implements I0 { a: number }
|
|
|
|
////interface I1 { b: number }
|
|
|
|
////interface I2 extends C1, I1 {}
|
|
|
|
////
|
|
|
|
////class C2 { c: number }
|
|
|
|
////interface I3 {d: number}
|
|
|
|
////class C3 extends C2 implements I0, I2, I3 {
|
|
|
|
//// a: number;
|
|
|
|
//// b: number;
|
|
|
|
//// d: number;
|
|
|
|
////}
|
|
|
|
////
|
|
|
|
////interface I4 { e: number }
|
|
|
|
////interface I5 { f: number }
|
|
|
|
////class C4 extends C3 implements I0, I4, I5 {
|
|
|
|
//// e: number;
|
|
|
|
//// f: number;
|
|
|
|
////}
|
|
|
|
////
|
|
|
|
////interface I6 extends C4 {}
|
|
|
|
////class C5 implements I6 {}
|
2016-10-28 20:57:30 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* We want to check whether the search for member to replace actually searches through
|
|
|
|
* the various possible paths of the inheritance chain correctly, and that We
|
|
|
|
* don't issue duplicates for the same member.
|
2017-12-07 21:14:18 +01:00
|
|
|
*
|
2016-10-28 20:57:30 +02:00
|
|
|
* Our class DAG:
|
2017-12-07 21:14:18 +01:00
|
|
|
*
|
2016-10-28 20:57:30 +02:00
|
|
|
* C5
|
|
|
|
* |-I6
|
|
|
|
* |-C4
|
|
|
|
* |-I4
|
|
|
|
* |-I5
|
|
|
|
* |------------------------ I0
|
|
|
|
* |-C3
|
|
|
|
* |-I2
|
|
|
|
* |-I1
|
|
|
|
* |-C1
|
|
|
|
* |-------------------I0
|
|
|
|
* |-I3
|
|
|
|
* |-----------------------I0
|
|
|
|
* |-C2
|
|
|
|
*/
|
|
|
|
|
2017-12-07 21:14:18 +01:00
|
|
|
verify.codeFix({
|
|
|
|
description: "Implement interface 'I6'",
|
|
|
|
newFileContent:
|
|
|
|
`// Referenced throughout the inheritance chain.
|
|
|
|
interface I0 { a: number }
|
|
|
|
|
|
|
|
class C1 implements I0 { a: number }
|
|
|
|
interface I1 { b: number }
|
|
|
|
interface I2 extends C1, I1 {}
|
|
|
|
|
|
|
|
class C2 { c: number }
|
|
|
|
interface I3 {d: number}
|
|
|
|
class C3 extends C2 implements I0, I2, I3 {
|
|
|
|
a: number;
|
|
|
|
b: number;
|
|
|
|
d: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface I4 { e: number }
|
|
|
|
interface I5 { f: number }
|
|
|
|
class C4 extends C3 implements I0, I4, I5 {
|
|
|
|
e: number;
|
|
|
|
f: number;
|
|
|
|
}
|
2016-10-28 20:57:30 +02:00
|
|
|
|
2017-12-07 21:14:18 +01:00
|
|
|
interface I6 extends C4 {}
|
2018-01-12 02:43:27 +01:00
|
|
|
class C5 implements I6 {
|
|
|
|
e: number;
|
|
|
|
f: number;
|
|
|
|
a: number;
|
|
|
|
b: number;
|
|
|
|
d: number;
|
|
|
|
c: number;
|
2017-12-07 21:14:18 +01:00
|
|
|
}`,
|
|
|
|
});
|