Skip to content
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

Set context when reporting summonInline errors #14405

Merged
merged 1 commit into from Feb 21, 2022
Merged

Set context when reporting summonInline errors #14405

merged 1 commit into from Feb 21, 2022

Conversation

andrzejressel
Copy link
Contributor

@andrzejressel andrzejressel commented Feb 2, 2022

Set proper context when reporting summonInline errors - and puts everything in inContext block, so this won't happen in the future.

@@ -852,7 +852,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
val evidence = evTyper.inferImplicitArg(tpt.tpe, tpt.span)(using evCtx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could wrap the whole block using inContext(evCtx) { ... } to make sure we don't accidentally use the wrong context anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@andrzejressel
Copy link
Contributor Author

I've signed CLA

@smarter smarter added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Feb 6, 2022
@nicolasstucki
Copy link
Contributor

fix #13406

Copy link
Contributor

@nicolasstucki nicolasstucki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrzejressel you should squash and rebases the commits and include a short message explaining what the fix is doing.

Otherwise LGTM

@andrzejressel andrzejressel changed the title fix #13406 Set context when reporting summonInline errors Feb 16, 2022
@andrzejressel
Copy link
Contributor Author

@nicolasstucki Fixed, should be fine now

@nicolasstucki nicolasstucki merged commit f19b850 into scala:main Feb 21, 2022
nicolasstucki added a commit to dotty-staging/dotty that referenced this pull request Feb 21, 2022
Make same fix in another part of the code.
nicolasstucki pushed a commit to dotty-staging/dotty that referenced this pull request Feb 21, 2022
@nicolasstucki nicolasstucki added backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" and removed backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. labels Feb 21, 2022
nicolasstucki added a commit to dotty-staging/dotty that referenced this pull request Feb 22, 2022
Make same fix in another part of the code.
anatoliykmetyuk added a commit that referenced this pull request Feb 25, 2022
@nicolasstucki nicolasstucki added backport:done This PR was successfully backported. and removed backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" labels Mar 4, 2022
@andrzejressel andrzejressel deleted the fix_13406 branch March 11, 2022 08:36
@Kordyjan Kordyjan added this to the 3.1.3 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:done This PR was successfully backported.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assertion failed: <notype> class dotty.tools.dotc.ast.Trees$TypeTree -1 in ReTyper
4 participants