{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9532","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9532/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9532/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9532/events","html_url":"https://github.com/Microsoft/TypeScript/issues/9532","id":164007694,"number":9532,"title":"re-export + augmentation does not work correctly unless extends matches","user":{"login":"unional","id":3254987,"avatar_url":"https://avatars.githubusercontent.com/u/3254987?v=3","gravatar_id":"","url":"https://api.github.com/users/unional","html_url":"https://github.com/unional","followers_url":"https://api.github.com/users/unional/followers","following_url":"https://api.github.com/users/unional/following{/other_user}","gists_url":"https://api.github.com/users/unional/gists{/gist_id}","starred_url":"https://api.github.com/users/unional/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unional/subscriptions","organizations_url":"https://api.github.com/users/unional/orgs","repos_url":"https://api.github.com/users/unional/repos","events_url":"https://api.github.com/users/unional/events{/privacy}","received_events_url":"https://api.github.com/users/unional/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-06T06:33:03Z","updated_at":"2016-07-06T06:33:03Z","closed_at":null,"body":"**TypeScript Version:**  (2.0.0-dev.20160705)\r\n\r\n**Code**\r\n\r\n```ts\r\n// foo.ts\r\ndeclare module 'A' {\r\n  export interface Foo<S> {\r\n    (): void;\r\n  }\r\n}\r\ndeclare module '~B' {\r\n  import { Foo as Roo } from 'A';\r\n  interface Foo extends Roo<any> {\r\n  }\r\n}\r\ndeclare module 'B' {\r\nexport * from '~B';\r\n}\r\n\r\n// boo.ts\r\ndeclare module 'B' {\r\n  interface Foo {\r\n     (message: string): any;\r\n  }\r\n}\r\n\r\nexport const SOME = 1;\r\n\r\n// go.ts\r\nimport { Foo } from 'B';\r\n\r\nlet x: Foo;\r\nx(); // <-- only have (message: string): any\r\n\r\n```\r\n\r\n**Expected behavior:**\r\n`x();` have overloads of `(message: string): any` and `(): void`\r\n\r\n**Actual behavior:** \r\n`x();` only have `(message: string): any`\r\n\r\nIf I change `boo.ts` to:\r\n```ts\r\n// boo.ts\r\nimport { Foo as Soo } from 'A';\r\ndeclare module 'B' {\r\n  interface Foo extends Soo<any> { // <-- i.e. matching original extends\r\n     (message: string): any;\r\n  }\r\n}\r\n\r\nexport const SOME = 1;\r\n```\r\n\r\nThen it work correctly.\r\n\r\nAlso, if I reference `~B` instead of `B`, it works correctly too:\r\n```ts\r\n// boo.ts\r\ndeclare module '~B' {\r\n  interface Foo {\r\n     (message: string): any;\r\n  }\r\n}\r\n\r\nexport const SOME = 1;\r\n\r\n// go.ts\r\nimport { Foo } from '~B';\r\n\r\nlet x: Foo;\r\nx()\r\n```"}}
{"actor":{"display_login":"unional"}}