Patch forthcoming.
Created attachment 319684 [details] the patch
Comment on attachment 319684 [details] the patch I'd like to add control flow statements soon. Hopefully I'm up to the task!
(In reply to Myles C. Maxfield from comment #2) > Comment on attachment 319684 [details] > the patch > > I'd like to add control flow statements soon. Hopefully I'm up to the task! The nice thing about those is that the type system basically doesn't have to know about them, so you can probably just let the Checker's and NameResolver's default Visitor methods take care of those control flow nodes. The one exception is ternaries. But that's easy - just verify that the two cases return the same type, and then return that type. I guess to do control flow, we'll either need a bool type, or we'll need a story for which types can be used as bools. How should that work? I guess bool could be a native type. Then you'd need to add a BoolLiteral class. Shouldn't be that hard. Do you want to do that, too?
Landed in https://trac.webkit.org/changeset/221513/webkit
(In reply to Filip Pizlo from comment #3) > (In reply to Myles C. Maxfield from comment #2) > > Comment on attachment 319684 [details] > > the patch > > > > I'd like to add control flow statements soon. Hopefully I'm up to the task! > > The nice thing about those is that the type system basically doesn't have to > know about them, so you can probably just let the Checker's and > NameResolver's default Visitor methods take care of those control flow nodes. > > The one exception is ternaries. But that's easy - just verify that the two > cases return the same type, and then return that type. > > I guess to do control flow, we'll either need a bool type, or we'll need a > story for which types can be used as bools. How should that work? > > I guess bool could be a native type. Then you'd need to add a BoolLiteral > class. Shouldn't be that hard. Do you want to do that, too? HLSL, GLSL, Metal, and OpenCL all have a native bool type. I see no reason to be different here.
<rdar://problem/34694242>
Migrated to https://github.com/gpuweb/WHLSL/issues/161