|
| 1 | +/// <reference path='fourslash.ts' /> |
| 2 | + |
| 3 | +// #35508 |
| 4 | + |
| 5 | +////interface IFoo1 { |
| 6 | +//// parse(reviver: () => any): void; |
| 7 | +////} |
| 8 | +//// |
| 9 | +////class Foo1 implements IFoo1 { |
| 10 | +////} |
| 11 | +//// |
| 12 | +////interface IFoo2 { |
| 13 | +//// parse(reviver: { (): any }): void; |
| 14 | +////} |
| 15 | +//// |
| 16 | +////class Foo2 implements IFoo2 { |
| 17 | +////} |
| 18 | +//// |
| 19 | +////interface IFoo3 { |
| 20 | +//// parse(reviver: new () => any): void; |
| 21 | +////} |
| 22 | +//// |
| 23 | +////class Foo3 implements IFoo3 { |
| 24 | +////} |
| 25 | +//// |
| 26 | +////interface IFoo4 { |
| 27 | +//// parse(reviver: { new (): any }): void; |
| 28 | +////} |
| 29 | +//// |
| 30 | +////class Foo4 implements IFoo4 { |
| 31 | +////} |
| 32 | + |
| 33 | +verify.codeFixAll({ |
| 34 | + fixAllDescription: ts.Diagnostics.Implement_all_unimplemented_interfaces.message, |
| 35 | + fixId: "fixClassIncorrectlyImplementsInterface", |
| 36 | + newFileContent: |
| 37 | +`interface IFoo1 { |
| 38 | + parse(reviver: () => any): void; |
| 39 | +} |
| 40 | +
|
| 41 | +class Foo1 implements IFoo1 { |
| 42 | + parse(reviver: () => any): void { |
| 43 | + throw new Error("Method not implemented."); |
| 44 | + } |
| 45 | +} |
| 46 | +
|
| 47 | +interface IFoo2 { |
| 48 | + parse(reviver: { (): any }): void; |
| 49 | +} |
| 50 | +
|
| 51 | +class Foo2 implements IFoo2 { |
| 52 | + parse(reviver: () => any): void { |
| 53 | + throw new Error("Method not implemented."); |
| 54 | + } |
| 55 | +} |
| 56 | +
|
| 57 | +interface IFoo3 { |
| 58 | + parse(reviver: new () => any): void; |
| 59 | +} |
| 60 | +
|
| 61 | +class Foo3 implements IFoo3 { |
| 62 | + parse(reviver: new () => any): void { |
| 63 | + throw new Error("Method not implemented."); |
| 64 | + } |
| 65 | +} |
| 66 | +
|
| 67 | +interface IFoo4 { |
| 68 | + parse(reviver: { new (): any }): void; |
| 69 | +} |
| 70 | +
|
| 71 | +class Foo4 implements IFoo4 { |
| 72 | + parse(reviver: new () => any): void { |
| 73 | + throw new Error("Method not implemented."); |
| 74 | + } |
| 75 | +}`}); |
0 commit comments