TypeScript/tests/baselines/reference/sigantureIsSubTypeIfTheyAreIdentical.js
2014-07-12 17:30:19 -07:00

20 lines
505 B
TypeScript

//// [sigantureIsSubTypeIfTheyAreIdentical.ts]
interface ICache {
get<T>(key: string): T;
}
class CacheService implements ICache { // Should not error that property type of get are incomaptible
get<T>(key: string): T {
return undefined;
}
}
//// [sigantureIsSubTypeIfTheyAreIdentical.js]
var CacheService = (function () {
function CacheService() {
}
CacheService.prototype.get = function (key) {
return undefined;
};
return CacheService;
})();