-
Notifications
You must be signed in to change notification settings - Fork 0
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
Type cast + less than #1150
Comments
We cannot generally fix this. Adjusting the lexer only fixes the issue in some cases. Other languages, like TypeScript, have the same behavior. We could give Or we could leave it as is, and document that parentheses must be used in this specific case (type cast followed by less than). |
Closes #1150 ### Summary of Changes Type casts now have the lowest precedence. In order to use them inside other expressions, they **must be enclosed in parentheses**.
Closes #1150 ### Summary of Changes * Type casts must now have parentheses around their type. This resolves the ambiguity between the less than operator and the start of type argument lists. * Restore their old, more intuitive precedence.
## [0.15.0](v0.14.1...v0.15.0) (2024-05-09) ### Features * adjust type cast syntax and restore old precedence ([#1158](#1158)) ([07623fc](07623fc)), closes [#1150](#1150) * disable "unused" warning for placeholders whose name starts with an underscore ([#1155](#1155)) ([25781a8](25781a8)), closes [#1154](#1154) * give type casts the lowest precedence ([#1157](#1157)) ([7549fa1](7549fa1)), closes [#1150](#1150) * integrate version 0.24.0 of the `safe-ds` Python library ([#1162](#1162)) ([1a24a18](1a24a18)) * remove warning that package is empty ([#1159](#1159)) ([b13c5df](b13c5df)), closes [#1153](#1153) * suggest adding assignment if statement does nothing ([#1156](#1156)) ([11c81b3](11c81b3)), closes [#1142](#1142)
🎉 This issue has been resolved in version 0.15.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Describe the bug
The parser confuses type argument lists and the less than operator. That's the same issues we've had with type argument lists of calls.
To Reproduce
Place this code into the editor:
Expected behavior
No error. The
<
should be treated as the less than operator, not the start of a type argument list.Screenshots (optional)
No response
Additional Context (optional)
No response
The text was updated successfully, but these errors were encountered: