TypeScript/tests/baselines/reference/typedGenericPrototypeMember.js

17 lines
389 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//// [typedGenericPrototypeMember.ts]
class List<T> {
add(item: T) { }
}
List.prototype.add("abc"); // Valid because T is instantiated to any
//// [typedGenericPrototypeMember.js]
var List = (function () {
function List() {
}
List.prototype.add = function (item) { };
2014-07-13 01:04:16 +02:00
return List;
})();
List.prototype.add("abc"); // Valid because T is instantiated to any