-
-
Notifications
You must be signed in to change notification settings - Fork 46
fix: Better error message when assigning to a value defined outside TGSL #1981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
pkg.pr.new packages benchmark commit |
|
I am not sure if this is proper way to detect 'assignment to variables defined outside TGSL'. We are adding support for 'for ... of ...' loop, so tinyest will change. Maybe you'll find a better place for that in tinyest parsers? EDIT: Nevermind, too much work for 1 error. LGTM |
## 📊 Bundle Size Comparison
👀 Notable resultsStatic test results:No major changes. Dynamic test results:No major changes. 📋 All resultsClick to reveal the results table (323 entries).
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu. |
wgslGenerator.tsAfter this, the
lhsExpressionalready is a constant snippet, so I decided to just update the error message for assigning to a constant.Case 1:
as was before, an error
Identifier a not foundis thrown.Case 2:
Now the error message is
'${lhsStr} = ${rhsStr}' is invalid, because ${lhsStr} is a constant. This error may also occur when assigning to a value defined outside of a TypeGPU function's scope.