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

fix #13994: initialise inline ctx in lateEnter #14050

Merged
merged 4 commits into from Dec 14, 2021

Conversation

bishabosha
Copy link
Member

In lateEnter the context is captured in the namer by the inline body annotation in completeInCreationContext. So we initialise the context for inlining before calling lateEnter.

I've not figured out a way to replicate this in sbt scripted tests, but you can experiment by copying the sources from #13994 to library/src-bootstrapped

fixes #13994

@bishabosha
Copy link
Member Author

bishabosha commented Dec 6, 2021

Before this can be merged we need to add a test case that can reproduce the original issue - sbt scripted tests do not appear to work for this, I have been told that the cmdTests can be useful here

@bishabosha bishabosha force-pushed the fix-13994-initial branch 5 times, most recently from 0f2f837 to f4d8965 Compare December 7, 2021 12:57
@bishabosha
Copy link
Member Author

This is ready to review - the test case reproduces the issue in #13994, requiring the fixes to Run to succeed

Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

I think we need some changes. Detailed review will follow

Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

Maybe evaluate whether some of this can be moved to Namer and be merged with lateEnter there. It's important to keep driver classes like Run clean and not burden them with implementation detail.

compiler/src/dotty/tools/dotc/Run.scala Outdated Show resolved Hide resolved
compiler/src/dotty/tools/dotc/Run.scala Outdated Show resolved Hide resolved
@bishabosha bishabosha force-pushed the fix-13994-initial branch 2 times, most recently from d2ed41e to 68f16a0 Compare December 13, 2021 12:28
@bishabosha
Copy link
Member Author

bishabosha commented Dec 13, 2021

@odersky I have moved most of the implementation of lateCompile to namer, except for a callback implemented in Run (for adding to finalizeActions)

compiler/src/dotty/tools/dotc/Run.scala Outdated Show resolved Hide resolved
project/scripts/bootstrapCmdTests Show resolved Hide resolved
project/scripts/bootstrapCmdTests Outdated Show resolved Hide resolved
@bishabosha
Copy link
Member Author

@smarter I added a comment to the cmd tests, I have also found a way to parse the scala version in bash so I deleted the changes related to loading scala version from java properties.

@bishabosha
Copy link
Member Author

@odersky would you like to check this again?

Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

I think that way it is structured better than before.

@odersky odersky merged commit 221fc71 into scala:master Dec 14, 2021
@odersky odersky deleted the fix-13994-initial branch December 14, 2021 17:00
@Kordyjan Kordyjan added this to the 3.1.2 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.

incremental crash: inlining from top-level object defined in file with other name
5 participants