TypeScript Interface Checking issue
Just a report of a wrong error detection:
I am on Resharper 2017.2 EAP 12 and have the following issue in my Angular 1.6 app: (TypeScript 2.1, VS2015)
My Code:
export class ActionController implements ng.IController { // ReSharper shows Error on ng.IController: Controller declares Interface but does not implement it
$onChanges(onChangesObj: angular.IOnChangesObject): void {...} // ERROR
}
However when I use 'Add missing overload signature' fix on the error, two implementations get inserted:
$onChanges(onChangesObj: angular.IOnChangesObject): void; // The same as I used!
$onChanges(onChangesObj: any): void;
As a workaround I changed my signature to the second interface definition and the error went away.
Another issue: I removed my $onChanges method and used the 'Generate \ overriding members' -> $onChanges action.
Then Reshaper throws an Exception: "An item with the same key has already been added". I have submitted this exception.
Please sign in to leave a comment.
Hello Chris!
Sorry for delay in responding.
Could you please provide some sample solution in which the issue is reproduced. Also some screenshots illustrating the issue wil be appreciated.
Thanks in advance!
Hello Angelina!
I just found out the problem is limited to my own non consistent usage on angular namespaces.
If I replace 'angular.IOnChangesObject' with 'ng.IOnChangesObject' the error goes away.
However, I thought ng and angular namespaces were equivalent.
https://1drv.ms/u/s!AgW0waW4FHmZg9JO7RimHtflYOAzMg
all the best, Chris