{"action":"opened","issue":{"url":"https://api.github.com/repos/shader-slang/slang/issues/513","repository_url":"https://api.github.com/repos/shader-slang/slang","labels_url":"https://api.github.com/repos/shader-slang/slang/issues/513/labels{/name}","comments_url":"https://api.github.com/repos/shader-slang/slang/issues/513/comments","events_url":"https://api.github.com/repos/shader-slang/slang/issues/513/events","html_url":"https://github.com/shader-slang/slang/issues/513","id":316351723,"number":513,"title":"Local `typedef`s don't work","user":{"login":"csyonghe","id":2652293,"avatar_url":"https://avatars2.githubusercontent.com/u/2652293?v=4","gravatar_id":"","url":"https://api.github.com/users/csyonghe","html_url":"https://github.com/csyonghe","followers_url":"https://api.github.com/users/csyonghe/followers","following_url":"https://api.github.com/users/csyonghe/following{/other_user}","gists_url":"https://api.github.com/users/csyonghe/gists{/gist_id}","starred_url":"https://api.github.com/users/csyonghe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csyonghe/subscriptions","organizations_url":"https://api.github.com/users/csyonghe/orgs","repos_url":"https://api.github.com/users/csyonghe/repos","events_url":"https://api.github.com/users/csyonghe/events{/privacy}","received_events_url":"https://api.github.com/users/csyonghe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-20T17:32:50Z","updated_at":"2018-04-20T17:32:50Z","closed_at":null,"author_association":"COLLABORATOR","body":"When a `typedef` definition is placed inside a function body, the `innerType` field of the `NamedExpressionType` will be null in semantics checking.\r\n\r\n```\r\n//TEST(compute):COMPARE_COMPUTE:\r\n//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out\r\n// Confirm that generics syntax can be used in user\r\n// code and generates valid output.\r\n\r\nRWStructuredBuffer<float4> outputBuffer;\r\n\r\ninterface IBxDF\r\n{\r\n    float getVal();\r\n};\r\n\r\nstruct ShadingPoint<TBxDF : IBxDF>\r\n{\r\n    TBxDF bxdf;\r\n};\r\n\r\n\r\n[numthreads(1, 1, 1)]\r\nvoid computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)\r\n{\r\n    typedef BxDF<5> BT;\r\n    typedef ShadingPoint<BT > BXDFType;\r\n    BXDFType b;\r\n    outputBuffer[0] = b.bxdf.getVal();\r\n}\r\n\r\nstruct BxDF<let x: int>\r\n{\r\n    float getVal() {return x;}\r\n};\r\n```"}}
{"actor":{"display_login":"csyonghe"}}