Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

WSL should not type-check functions in the standard library that it does not use #177

Closed
litherum opened this issue Oct 14, 2018 · 5 comments

Comments

@litherum
Copy link
Contributor

Migrated from https://bugs.webkit.org/show_bug.cgi?id=177269:

At 2017-09-20T21:13:53Z, fpizlo@apple.com wrote:
Patch forthcoming.

@litherum
Copy link
Contributor Author

At 2017-09-20T21:19:11Z, fpizlo@apple.com wrote:
Created attachment 321367
the patch

@litherum
Copy link
Contributor Author

At 2017-09-20T21:26:04Z, jfbastien@apple.com wrote:
Comment on attachment 321367
the patch

View in context: https://bugs.webkit.org/attachment.cgi?id=321367&action=review

r=me

Tools/WebGPUShadingLanguageRI/NameContext.js:97

  •    if (thing.kind == Func) {
    

=== ?

Tools/WebGPUShadingLanguageRI/Prepare.js:29

  • return function(origin, lineNumberOffset, text) {

Why?

Tools/WebGPUShadingLanguageRI/ProgramWithUnnecessaryThingsRemoved.js:33

  •    if (statement.origin.originKind == "user")
    

=== ?

Tools/WebGPUShadingLanguageRI/ProgramWithUnnecessaryThingsRemoved.js:40

  • // We need these even if the program doesn't mention them by name.

Why?

@litherum
Copy link
Contributor Author

At 2017-09-20T22:09:14Z, fpizlo@apple.com wrote:
(In reply to JF Bastien from comment #2)

Comment on attachment 321367 [details]
the patch

View in context:
https://bugs.webkit.org/attachment.cgi?id=321367&action=review

r=me

Tools/WebGPUShadingLanguageRI/NameContext.js:97

  •    if (thing.kind == Func) {
    

=== ?

Fixed.

Tools/WebGPUShadingLanguageRI/Prepare.js:29

  • return function(origin, lineNumberOffset, text) {

Why?

arguments.length doesn't work in arrow functions.

Tools/WebGPUShadingLanguageRI/ProgramWithUnnecessaryThingsRemoved.js:33

  •    if (statement.origin.originKind == "user")
    

=== ?

Fixed.

Tools/WebGPUShadingLanguageRI/ProgramWithUnnecessaryThingsRemoved.js:40

  • // We need these even if the program doesn't mention them by name.

Why?

Later phases resolve these directly sometimes (the compiler will say things like program.globalNameContext.get(Type, "void") and expect non-null).

For example even if you compile "int foo() { return 42; }", we will resolve void just to make sure that int isn't the same as void - because if int was void then the return shouldn't return a value.

Also if you compile "double foo() { return 42; }" we will also resolve int because "42" might be an int (we actually select double as 42's type but not before trying int).

@litherum
Copy link
Contributor Author

At 2017-09-20T22:41:17Z, fpizlo@apple.com wrote:
Landed in https://trac.webkit.org/changeset/222295/webkit

@litherum
Copy link
Contributor Author

At 2017-09-27T19:20:01Z, webkit-bug-importer@group.apple.com wrote:
rdar://problem/34693070

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant