This should resolve unambiguously: int foo(int) uint foo(uint) foo(42) This should be an error: uint foo(uint) double foo(double) foo(42)
Created attachment 320407 [details] the patch
Comment on attachment 320407 [details] the patch View in context: https://bugs.webkit.org/attachment.cgi?id=320407&action=review > Tools/WebGPUShadingLanguageRI/Test.js:1439 > + int foo<T>(T) { return 1; } Why should this fail? I would expect T to become an int.
(In reply to Myles C. Maxfield from comment #2) > Comment on attachment 320407 [details] > the patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=320407&action=review > > > Tools/WebGPUShadingLanguageRI/Test.js:1439 > > + int foo<T>(T) { return 1; } > > Why should this fail? I would expect T to become an int. I think that's what we should eventually do. It would take some extra effort to implement this. Filed: https://bugs.webkit.org/show_bug.cgi?id=176707
Landed in https://trac.webkit.org/changeset/221859/webkit
(In reply to Filip Pizlo from comment #3) > (In reply to Myles C. Maxfield from comment #2) > > Comment on attachment 320407 [details] > > the patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=320407&action=review > > > > > Tools/WebGPUShadingLanguageRI/Test.js:1439 > > > + int foo<T>(T) { return 1; } > > > > Why should this fail? I would expect T to become an int. > > I think that's what we should eventually do. It would take some extra > effort to implement this. > > Filed: https://bugs.webkit.org/show_bug.cgi?id=176707 If we expect that an idea language wouldn't work this way, we probably shouldn't have this as a test.
(In reply to Myles C. Maxfield from comment #5) > (In reply to Filip Pizlo from comment #3) > > (In reply to Myles C. Maxfield from comment #2) > > > Comment on attachment 320407 [details] > > > the patch > > > > > > View in context: > > > https://bugs.webkit.org/attachment.cgi?id=320407&action=review > > > > > > > Tools/WebGPUShadingLanguageRI/Test.js:1439 > > > > + int foo<T>(T) { return 1; } > > > > > > Why should this fail? I would expect T to become an int. > > > > I think that's what we should eventually do. It would take some extra > > effort to implement this. > > > > Filed: https://bugs.webkit.org/show_bug.cgi?id=176707 > > If we expect that an idea language wouldn't work this way, we probably > shouldn't have this as a test. **ideal language
(In reply to Myles C. Maxfield from comment #6) > (In reply to Myles C. Maxfield from comment #5) > > (In reply to Filip Pizlo from comment #3) > > > (In reply to Myles C. Maxfield from comment #2) > > > > Comment on attachment 320407 [details] > > > > the patch > > > > > > > > View in context: > > > > https://bugs.webkit.org/attachment.cgi?id=320407&action=review > > > > > > > > > Tools/WebGPUShadingLanguageRI/Test.js:1439 > > > > > + int foo<T>(T) { return 1; } > > > > > > > > Why should this fail? I would expect T to become an int. > > > > > > I think that's what we should eventually do. It would take some extra > > > effort to implement this. > > > > > > Filed: https://bugs.webkit.org/show_bug.cgi?id=176707 > > > > If we expect that an idea language wouldn't work this way, we probably > > shouldn't have this as a test. > > **ideal language More tests are better. I think it's good practice to add tests for how you expect your code to behave right now, even if that means having to change the test later. That makes sense here, since the current behavior isn't really "wrong" (it doesn't render the type system unsound or anything like that) - it's just subject to change.
<rdar://problem/34693466>
Migrated to https://github.com/gpuweb/WHLSL/issues/145