{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7347","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7347/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7347/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7347/events","html_url":"https://github.com/Microsoft/TypeScript/issues/7347","id":137981366,"number":7347,"title":"ECMAScript spread param rules causing loss of type-safety (and slower compile time?)","user":{"login":"blesh","id":1540597,"avatar_url":"https://avatars.githubusercontent.com/u/1540597?v=3","gravatar_id":"","url":"https://api.github.com/users/blesh","html_url":"https://github.com/blesh","followers_url":"https://api.github.com/users/blesh/followers","following_url":"https://api.github.com/users/blesh/following{/other_user}","gists_url":"https://api.github.com/users/blesh/gists{/gist_id}","starred_url":"https://api.github.com/users/blesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blesh/subscriptions","organizations_url":"https://api.github.com/users/blesh/orgs","repos_url":"https://api.github.com/users/blesh/repos","events_url":"https://api.github.com/users/blesh/events{/privacy}","received_events_url":"https://api.github.com/users/blesh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-02T20:19:50Z","updated_at":"2016-03-02T20:34:50Z","closed_at":null,"body":"I think we're hitting a similar situation to #1336 with RxJS 5, which is causing some crazy workarounds for some minimal type-safety, which in turn is causing slower build times.\r\n\r\nIdeally what we'd have is this:\r\n```TypeScript\r\n// Observable.prototype.concat\r\nconcat<R>(...observables: ObservableInput<any>[], scheduler?: Scheduler): Observable<R>\r\n```\r\n\r\nBut since that's illegal, we're forced to do this:\r\n\r\n```TypeScript\r\nconcat<R>(...args: Array<ObservableInput<any> | Scheduler>): Observable<R>\r\n```\r\n\r\n... that clearly doesn't give us what we want for type safety, so we end up defining a crazy list of common type signatures like:\r\n\r\n```TypeScript\r\n/* tslint:disable:max-line-length */\r\nexport interface ConcatSignature<T> {\r\n  (scheduler?: Scheduler): Observable<T>;\r\n  <T2>(v2: ObservableInput<T2>, scheduler?: Scheduler): Observable<T | T2>;\r\n  <T2, T3>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, scheduler?: Scheduler): Observable<T | T2 | T3>;\r\n  <T2, T3, T4>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, scheduler?: Scheduler): Observable<T | T2 | T3 | T4>;\r\n  <T2, T3, T4, T5>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, scheduler?: Scheduler): Observable<T | T2 | T3 | T4 | T5>;\r\n  <T2, T3, T4, T5, T6>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, scheduler?: Scheduler): Observable<T | T2 | T3 | T4 | T5 | T6>;\r\n  (...observables: Array<ObservableInput<T> | Scheduler>): Observable<T>;\r\n  <R>(...observables: Array<ObservableInput<any> | Scheduler>): Observable<R>;\r\n}\r\n/* tslint:enable:max-line-length */\r\n```\r\n\r\nI believe this is directly related to compilation speed issues that @mhegazy wanted to discuss with me.\r\n\r\ncc/ @kwonoj @david-driscoll @jayphelps"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/191417616","html_url":"https://github.com/Microsoft/TypeScript/issues/7347#issuecomment-191417616","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7347","id":191417616,"user":{"login":"blesh","id":1540597,"avatar_url":"https://avatars.githubusercontent.com/u/1540597?v=3","gravatar_id":"","url":"https://api.github.com/users/blesh","html_url":"https://github.com/blesh","followers_url":"https://api.github.com/users/blesh/followers","following_url":"https://api.github.com/users/blesh/following{/other_user}","gists_url":"https://api.github.com/users/blesh/gists{/gist_id}","starred_url":"https://api.github.com/users/blesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blesh/subscriptions","organizations_url":"https://api.github.com/users/blesh/orgs","repos_url":"https://api.github.com/users/blesh/repos","events_url":"https://api.github.com/users/blesh/events{/privacy}","received_events_url":"https://api.github.com/users/blesh/received_events","type":"User","site_admin":false},"created_at":"2016-03-02T20:34:50Z","updated_at":"2016-03-02T20:34:50Z","body":"Now in ECMAScript, I think they could loosen the rules, but not as much as you could in a typed language. For example, without types: `foo(...bar, baz, ...qux)` would be impossible to suss out. But with types, it's actually doable at compile time: `foo(...bar:number[], baz:string, ...qux:number[])`.\r\n\r\nWe don't have to go all-in with this change, but I would be happy with just allowing them in places that are doable in ECMAScript"}}