{"action":"created","issue":{"url":"https://api.github.com/repos/insieme/insieme/issues/25","labels_url":"https://api.github.com/repos/insieme/insieme/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/insieme/insieme/issues/25/comments","events_url":"https://api.github.com/repos/insieme/insieme/issues/25/events","html_url":"https://github.com/insieme/insieme/issues/25","id":66097169,"number":25,"title":"Unhandled capturing of generic types within nested Job Expressions","user":{"login":"stefanmoosbrugger","id":8113223,"avatar_url":"https://avatars.githubusercontent.com/u/8113223?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanmoosbrugger","html_url":"https://github.com/stefanmoosbrugger","followers_url":"https://api.github.com/users/stefanmoosbrugger/followers","following_url":"https://api.github.com/users/stefanmoosbrugger/following{/other_user}","gists_url":"https://api.github.com/users/stefanmoosbrugger/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanmoosbrugger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanmoosbrugger/subscriptions","organizations_url":"https://api.github.com/users/stefanmoosbrugger/orgs","repos_url":"https://api.github.com/users/stefanmoosbrugger/repos","events_url":"https://api.github.com/users/stefanmoosbrugger/events{/privacy}","received_events_url":"https://api.github.com/users/stefanmoosbrugger/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/insieme/insieme/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/insieme/insieme/labels/core","name":"core","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-04-03T07:25:01Z","updated_at":"2015-04-08T14:00:46Z","closed_at":null,"body":"There is a problem when trying to deduce types \r\nin a nested IR structure. Imagine you have a derived \r\noeprator that looks like this:\r\n\r\n```\r\nlet bla = struct { threadgroup x } in \r\n( 'a arg )->unit { \r\n   arg(); \r\n   x = parallel(job([1-1]) { arg(); });   \r\n}\r\n```\r\n\r\nThe type 'a is deduced in a correct way in the outer call of arg().\r\nUnfortunately the type information is not forwarded into the \r\nparallel or job construct. This will introduce a semantic error\r\nbecause the type of arg() in the parallel job is 'a and not known."},"comment":{"url":"https://api.github.com/repos/insieme/insieme/issues/comments/90925633","html_url":"https://github.com/insieme/insieme/issues/25#issuecomment-90925633","issue_url":"https://api.github.com/repos/insieme/insieme/issues/25","id":90925633,"user":{"login":"stefanmoosbrugger","id":8113223,"avatar_url":"https://avatars.githubusercontent.com/u/8113223?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanmoosbrugger","html_url":"https://github.com/stefanmoosbrugger","followers_url":"https://api.github.com/users/stefanmoosbrugger/followers","following_url":"https://api.github.com/users/stefanmoosbrugger/following{/other_user}","gists_url":"https://api.github.com/users/stefanmoosbrugger/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanmoosbrugger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanmoosbrugger/subscriptions","organizations_url":"https://api.github.com/users/stefanmoosbrugger/orgs","repos_url":"https://api.github.com/users/stefanmoosbrugger/repos","events_url":"https://api.github.com/users/stefanmoosbrugger/events{/privacy}","received_events_url":"https://api.github.com/users/stefanmoosbrugger/received_events","type":"User","site_admin":false},"created_at":"2015-04-08T14:00:46Z","updated_at":"2015-04-08T14:00:46Z","body":"I aggree. Yes, this is exactly how the IR job expression is mapped. \r\nOk. so now lets modify the derived operator a little bit.\r\n\r\nNew derived operator:\r\n```\r\n\"('a f) -> unit { \"\r\n\"   auto y = f;\"\r\n\"   parallel(job { auto z = f; }); \"\r\n\"}\"\r\n```\r\n\r\nPrint before instatiation:\r\n-Detail\r\n```\r\nlet fun000 = $[NormalizeAnnotation: fun('a $[Value(NameTag): v1]$) -> unit {\r\n    decl 'a $[Value(NameTag): v2]$ = $[Value(NameTag): v1]$;\r\n}]$;\r\n\r\nlet fun001 = $[Value(DerivedTag), NormalizeAnnotation: fun('a $[Value(NameTag): v1]$) -> unit {\r\n    decl 'a $[Value(NameTag): v2]$ = $[Value(NameTag): v1]$;\r\n    parallel:$[VariableInstantionInfo: (job) -> threadgroup]$(job(([1:uint<8>-inf])){\r\n        bind(){fun000($[Value(NameTag): v1]$)}\r\n    });\r\n}]$;\r\n\r\nfun001(v5)\r\n```\r\nPrint after instantiation:\r\n-Pretty:\r\n```\r\nlet fun000 = fun('a v1) -> unit {\r\n    decl 'a v2 = v1;\r\n};\r\n\r\nlet fun001 = fun(int<4> v1) -> unit {\r\n    decl int<4> v2 = v1;\r\n    parallel(job([1-inf]){\r\n        bind(){fun000(v1)}\r\n    });\r\n};\r\n\r\nfun001\r\n```"}}