{"action":"created","issue":{"url":"https://api.github.com/repos/angular/clutz/issues/269","repository_url":"https://api.github.com/repos/angular/clutz","labels_url":"https://api.github.com/repos/angular/clutz/issues/269/labels{/name}","comments_url":"https://api.github.com/repos/angular/clutz/issues/269/comments","events_url":"https://api.github.com/repos/angular/clutz/issues/269/events","html_url":"https://github.com/angular/clutz/issues/269","id":146657180,"number":269,"title":"Wrong Type parameters.","user":{"login":"jDramaix","id":1102761,"avatar_url":"https://avatars.githubusercontent.com/u/1102761?v=3","gravatar_id":"","url":"https://api.github.com/users/jDramaix","html_url":"https://github.com/jDramaix","followers_url":"https://api.github.com/users/jDramaix/followers","following_url":"https://api.github.com/users/jDramaix/following{/other_user}","gists_url":"https://api.github.com/users/jDramaix/gists{/gist_id}","starred_url":"https://api.github.com/users/jDramaix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jDramaix/subscriptions","organizations_url":"https://api.github.com/users/jDramaix/orgs","repos_url":"https://api.github.com/users/jDramaix/repos","events_url":"https://api.github.com/users/jDramaix/events{/privacy}","received_events_url":"https://api.github.com/users/jDramaix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-07T15:20:48Z","updated_at":"2016-04-21T13:16:56Z","closed_at":null,"body":"The type parameters seems not to be converted correctly. Let’s take the Array example and compare the definition of the type in extern and its conversion in typescript:\r\n\r\nEs3.js (for the sake of the example, we just keep JsDoc annotations that are relevant for the issue)\r\n\r\n```\r\n/**\r\n * @constructor\r\n * @implements {IArrayLike<T>}\r\n * @template T\r\n */\r\nfunction Array(var_args) {}\r\n\r\n/**\r\n * @record\r\n * @extends {IObject<number, VALUE2>}\r\n * @template VALUE2\r\n */\r\nfunction IArrayLike() {}\r\n\r\n/**\r\n * @interface\r\n * @template KEY1, VALUE1\r\n */\r\nfunction IObject() {}\r\n```\r\n\r\ngenerated .d.ts code:\r\n\r\n```\r\nclass Array<IObject#VALUE, T> extends Array_Instance<IObject#VALUE, T> {}\r\n\r\nclass Array_Instance<IObject#VALUE, T> implements ArrayLike<T> {}\r\n\r\ninterface IArrayLike<VALUE2> extends IObject<number, VALUE2> {}\r\n\r\ninterface IObject<IObject#KEY1, IObject#VALUE> {}\r\n```\r\n\r\nNote the ```#``` in the type parameter identifier that is not valid in typescript."},"comment":{"url":"https://api.github.com/repos/angular/clutz/issues/comments/212915022","html_url":"https://github.com/angular/clutz/issues/269#issuecomment-212915022","issue_url":"https://api.github.com/repos/angular/clutz/issues/269","id":212915022,"user":{"login":"jDramaix","id":1102761,"avatar_url":"https://avatars.githubusercontent.com/u/1102761?v=3","gravatar_id":"","url":"https://api.github.com/users/jDramaix","html_url":"https://github.com/jDramaix","followers_url":"https://api.github.com/users/jDramaix/followers","following_url":"https://api.github.com/users/jDramaix/following{/other_user}","gists_url":"https://api.github.com/users/jDramaix/gists{/gist_id}","starred_url":"https://api.github.com/users/jDramaix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jDramaix/subscriptions","organizations_url":"https://api.github.com/users/jDramaix/orgs","repos_url":"https://api.github.com/users/jDramaix/repos","events_url":"https://api.github.com/users/jDramaix/events{/privacy}","received_events_url":"https://api.github.com/users/jDramaix/received_events","type":"User","site_admin":false},"created_at":"2016-04-21T13:16:56Z","updated_at":"2016-04-21T13:16:56Z","body":"After some investigations, this is a problem in the JsCompiler itself and are very specific to `Array` and `Object` types. I will open a bug to JsCompiler product and I can propose a workaround in clutz to avoid this problem."}}