I just started a new project in TypeScript 0.9.5, and the following code throws an error:
The Service class is declared by IService, but does not implement it. The 'getUserInfo' property, defined as private in the Service type, is defined as public in the IService type
module App.Interfaces {
export interface IService {
getUserInfo(): void;
}
}
module App.Services {
export class Service implements App.Interfaces.IService {
private getUserInfo(): void { }
}
}
As long as I used TypeScript, I know that interfaces cannot have access modifiers! What gives?
Typescript example playground
source
share