==== tests/cases/compiler/extendArray.ts (2 errors) ==== var a = [1,2]; a.forEach(function (v,i,a) {}); declare module _Core { interface Array { collect(fn:(e:_element) => _element[]) : any[]; ~~~~~~~~ !!! Cannot find name '_element'. ~~~~~~~~ !!! Cannot find name '_element'. } } var arr = (Array).prototype; arr.collect = function (fn) { var res = []; for (var i = 0; i < this.length; ++i) { var tmp = fn(this[i]); for (var j = 0; j < tmp.length; ++j) { res.push(tmp[j]); } } return res; };