TypeScript/tests/baselines/reference/genericInterfaceImplementation.js

31 lines
539 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//// [genericInterfaceImplementation.ts]
interface IOption<A> {
get(): A;
flatten<B>(): IOption<B>;
}
class None<T> implements IOption<T>{
get(): T {
throw null;
}
flatten<U>() : IOption<U> {
return new None<U>();
}
}
//// [genericInterfaceImplementation.js]
var None = (function () {
function None() {
}
None.prototype.get = function () {
throw null;
};
None.prototype.flatten = function () {
return new None();
};
return None;
})();