{"action":"created","issue":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4002","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4002/labels{/name}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4002/comments","events_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4002/events","html_url":"https://github.com/HaxeFoundation/haxe/issues/4002","id":60586157,"number":4002,"title":"[cs] Type constraints causing invalid C# code","user":{"login":"dogles","id":1794520,"avatar_url":"https://avatars.githubusercontent.com/u/1794520?v=3","gravatar_id":"","url":"https://api.github.com/users/dogles","html_url":"https://github.com/dogles","followers_url":"https://api.github.com/users/dogles/followers","following_url":"https://api.github.com/users/dogles/following{/other_user}","gists_url":"https://api.github.com/users/dogles/gists{/gist_id}","starred_url":"https://api.github.com/users/dogles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dogles/subscriptions","organizations_url":"https://api.github.com/users/dogles/orgs","repos_url":"https://api.github.com/users/dogles/repos","events_url":"https://api.github.com/users/dogles/events{/privacy}","received_events_url":"https://api.github.com/users/dogles/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/HaxeFoundation/haxe/labels/regression","name":"regression","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"waneck","id":178171,"avatar_url":"https://avatars.githubusercontent.com/u/178171?v=3","gravatar_id":"","url":"https://api.github.com/users/waneck","html_url":"https://github.com/waneck","followers_url":"https://api.github.com/users/waneck/followers","following_url":"https://api.github.com/users/waneck/following{/other_user}","gists_url":"https://api.github.com/users/waneck/gists{/gist_id}","starred_url":"https://api.github.com/users/waneck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waneck/subscriptions","organizations_url":"https://api.github.com/users/waneck/orgs","repos_url":"https://api.github.com/users/waneck/repos","events_url":"https://api.github.com/users/waneck/events{/privacy}","received_events_url":"https://api.github.com/users/waneck/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/milestones/1","html_url":"https://github.com/HaxeFoundation/haxe/milestones/3.2","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/milestones/1/labels","id":343008,"number":1,"title":"3.2","description":"","creator":{"login":"issuesbot","id":4543331,"avatar_url":"https://avatars.githubusercontent.com/u/4543331?v=3","gravatar_id":"","url":"https://api.github.com/users/issuesbot","html_url":"https://github.com/issuesbot","followers_url":"https://api.github.com/users/issuesbot/followers","following_url":"https://api.github.com/users/issuesbot/following{/other_user}","gists_url":"https://api.github.com/users/issuesbot/gists{/gist_id}","starred_url":"https://api.github.com/users/issuesbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/issuesbot/subscriptions","organizations_url":"https://api.github.com/users/issuesbot/orgs","repos_url":"https://api.github.com/users/issuesbot/repos","events_url":"https://api.github.com/users/issuesbot/events{/privacy}","received_events_url":"https://api.github.com/users/issuesbot/received_events","type":"User","site_admin":false},"open_issues":96,"closed_issues":495,"state":"open","created_at":"2013-05-28T03:42:24Z","updated_at":"2015-03-10T23:51:43Z","due_on":"2015-03-14T23:00:00Z","closed_at":null},"comments":1,"created_at":"2015-03-10T23:23:09Z","updated_at":"2015-03-11T00:46:57Z","closed_at":null,"body":"Tested with latest Haxe on git.\r\nRepro: Compile the following code to C#:\r\n\r\n```\r\npackage;\r\n\r\nclass A {\r\n  public function foo() {}\r\n}\r\n\r\nclass B<T:A> {\r\n  public var a:T;\r\n  public function new(a:T) {\r\n    this.a = a;\r\n    var x = function() {\r\n      a.foo();\r\n    }\r\n    x();\r\n  }\r\n}\r\n\r\nclass BugTest {\r\n  public static function main() {}\r\n}\r\n```\r\n\r\nResult: Error in C# compilation:\r\nBugTest.hx(11,38): error CS0314: The type `T_c' cannot be used as type parameter `T_c' in the generic type or method `B___hx_ctor__B_11__Fun<T_c>'. There is no boxing or type parameter conversion from `T_c' to `A'\r\n\r\nThe problem is that the C# type parameter constraint is specified for the functor, but not on the class or static hx_ctor method. This is a recent regression."},"comment":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/comments/78179859","html_url":"https://github.com/HaxeFoundation/haxe/issues/4002#issuecomment-78179859","issue_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4002","id":78179859,"user":{"login":"nadako","id":49749,"avatar_url":"https://avatars.githubusercontent.com/u/49749?v=3","gravatar_id":"","url":"https://api.github.com/users/nadako","html_url":"https://github.com/nadako","followers_url":"https://api.github.com/users/nadako/followers","following_url":"https://api.github.com/users/nadako/following{/other_user}","gists_url":"https://api.github.com/users/nadako/gists{/gist_id}","starred_url":"https://api.github.com/users/nadako/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nadako/subscriptions","organizations_url":"https://api.github.com/users/nadako/orgs","repos_url":"https://api.github.com/users/nadako/repos","events_url":"https://api.github.com/users/nadako/events{/privacy}","received_events_url":"https://api.github.com/users/nadako/received_events","type":"User","site_admin":false},"created_at":"2015-03-11T00:46:57Z","updated_at":"2015-03-11T00:46:57Z","body":"Hmm, this is probably caused by f045215fbf65b51504cecb30f5713787d9deb0a3, I had no idea that closure classes are `@:nativeGen` as well."}}