Skip to content

fix #SCL-23707 #677

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

Open
wants to merge 2 commits into
base: idea251.x
Choose a base branch
from

Conversation

Alex1005a
Copy link
Contributor

@Alex1005a Alex1005a commented Mar 23, 2025

To fix the problem I had to change the parsing of interpolated string. I'm not sure if it's correct, but I couldn't find another way.

https://youtrack.jetbrains.com/issue/SCL-23707

@unkarjedy
Copy link
Member

unkarjedy commented Mar 29, 2025

Thank you for the contribution and sorry for the late reply!
Please add tests to all the effected subsystems (in this case parser, parameter info, annotator/type inference (original issue is the red code))

@unkarjedy
Copy link
Member

I don't think that changing the parser is needed here.
It also goes against Scala definition of what Scala interpolated string is
https://docs.scala-lang.org/scala3/reference/syntax.html

@Alex1005a
Copy link
Contributor Author

Yes, from the specification point of view it is not correct. I did it this way because interpolated string is parsed first into an intermediate structure, and not immediately desugar as in the scala compiler. Desugaring occurs in the desugaredExpression method, and if no arguments are passed to the function from interpolator during it, the type check will fail.
There is probably a more correct way to do this, but I don't know about it, since I am not very familiar with the code base and the project architecture.

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

Successfully merging this pull request may close these issues.

2 participants