20 lines
505 B
JavaScript
20 lines
505 B
JavaScript
|
//// [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;
|
||
|
})();
|