Skip to content

Don't chain conversions when looking for import suggestions #12409

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

Merged

Conversation

smarter
Copy link
Member

@smarter smarter commented May 10, 2021

Fixes #12394.

@smarter smarter requested a review from odersky May 10, 2021 17:57
@soronpo
Copy link
Contributor

soronpo commented May 11, 2021

@smarter I can confirm this PR solves the reentry issue, but the compiler does not report the error thrown with report.throwError, like it does for non-transparent macros. Is that deliberate or a bug? Should I file a separate issue?

@smarter
Copy link
Member Author

smarter commented May 11, 2021

I don't think so, if an error is thrown when trying to type your implicit conversion, then that means it's not a valid implicit conversion so the compile rolls back. For a non-transparent inline the error will not be found until after typechecking, at that point it's too late to roll back so the error gets displayed to the user.

@soronpo
Copy link
Contributor

soronpo commented May 11, 2021

IIRC, in Scala 2 the implicit conversion macros controlled the error message. Why should it be different in Scala 3?

@smarter
Copy link
Member Author

smarter commented May 11, 2021

I don't know anything about Scala 2 macros so I can't say, but this discussion isn't related to this PR, feel free to open a separate discussion thread with examples.

@odersky odersky merged commit aa954de into scala:master May 11, 2021
@odersky odersky deleted the no-chained-conversion-suggestion branch May 11, 2021 12:39
@Kordyjan Kordyjan added this to the 3.0.1 milestone Aug 2, 2023
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.

transparent inline implicit conversion def is called again and again
5 participants