{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4149","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4149/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4149/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4149/events","html_url":"https://github.com/Microsoft/TypeScript/issues/4149","id":98946877,"number":4149,"title":"Circular dependency","user":{"login":"desperate-man","id":1643399,"avatar_url":"https://avatars.githubusercontent.com/u/1643399?v=3","gravatar_id":"","url":"https://api.github.com/users/desperate-man","html_url":"https://github.com/desperate-man","followers_url":"https://api.github.com/users/desperate-man/followers","following_url":"https://api.github.com/users/desperate-man/following{/other_user}","gists_url":"https://api.github.com/users/desperate-man/gists{/gist_id}","starred_url":"https://api.github.com/users/desperate-man/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/desperate-man/subscriptions","organizations_url":"https://api.github.com/users/desperate-man/orgs","repos_url":"https://api.github.com/users/desperate-man/repos","events_url":"https://api.github.com/users/desperate-man/events{/privacy}","received_events_url":"https://api.github.com/users/desperate-man/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Question","name":"Question","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-08-04T11:33:25Z","updated_at":"2015-08-11T00:30:33Z","closed_at":null,"body":"Looks like I have a circular dependency between three classes ('->' means 'references'): A -> B -> C -> A.\r\n\r\nClass A:\r\n\r\n    import B = require('services/B');\r\n\r\n    class A\r\n    {\r\n\t    run()\r\n\t    {\r\n\t\t    B.run();\r\n\t    }\r\n    }\r\n\r\n    export = A;\r\n\r\nClass B:\r\n\r\n    import C = require('services/C');\r\n\r\n    class B\r\n    {\r\n\t    run()\r\n\t    {\r\n\t\t    C.run();\r\n\t    }\r\n    }\r\n\r\n    export = B;\r\n\r\nClass C:\r\n\r\n    import A = require('services/A');\r\n\r\n    class C\r\n    {\r\n\t    run()\r\n\t    {\r\n\t\t    A.run();\r\n\t    }\r\n    }\r\n\r\n    export = C;\r\n\r\nWhenever I try to execute **C.run** in **B** I get exception: *\"TypeError: C.run is not a function\"* and in debug mode **C** is nothing, but an empty object.\r\n\r\nOk, I can redesign my classes to break the chain, but is it possible to have such references in TypeScript and what do I need to do?"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/129656731","html_url":"https://github.com/Microsoft/TypeScript/issues/4149#issuecomment-129656731","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4149","id":129656731,"user":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars.githubusercontent.com/u/8000722?v=3","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"created_at":"2015-08-11T00:30:32Z","updated_at":"2015-08-11T00:30:32Z","body":"static getter/setter is by design. you can find more about it at https://github.com/Microsoft/TypeScript/issues/1520#issuecomment-67369005"}}