Patch forthcoming.
I think that if you use an integer literal without any suffixes, then it should unify with any type in which that literal is representable.
Created attachment 319789 [details] the patch
Created attachment 319796 [details] the patch Added more tests.
Comment on attachment 319796 [details] the patch View in context: https://bugs.webkit.org/attachment.cgi?id=319796&action=review > Tools/ChangeLog:24 > + Also updated Test.html so that it runs again and is better at printing things. So the following wouldn't work: int x = 4; double y = x; But the following would work: double y = 4; > Tools/WebGPUShadingLanguageRI/IntLiteralType.js:57 > + print("Unified with: " + realThis); print() :( > Tools/WebGPUShadingLanguageRI/Intrinsics.js:67 > + type.isInt = true; I never see this read from. What is it used for?
Landed in https://trac.webkit.org/changeset/221593/webkit
(In reply to Myles C. Maxfield from comment #4) > Comment on attachment 319796 [details] > the patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=319796&action=review > > > Tools/ChangeLog:24 > > + Also updated Test.html so that it runs again and is better at printing things. > > So the following wouldn't work: > int x = 4; > double y = x; > > But the following would work: > double y = 4; Right. > > > Tools/WebGPUShadingLanguageRI/IntLiteralType.js:57 > > + print("Unified with: " + realThis); > > print() :( I removed it! > > > Tools/WebGPUShadingLanguageRI/Intrinsics.js:67 > > + type.isInt = true; > > I never see this read from. What is it used for? It's not used right now. I added it because all compilers eventually need to ask their types if they are int or float.
<rdar://problem/34694473>
Migrated to https://github.com/gpuweb/WHLSL/issues/200