Skip to content

Fix #9227: Do not suspend REPL compilation unit #9232

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
merged 3 commits into from
Jun 25, 2020

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki nicolasstucki linked an issue Jun 24, 2020 that may be closed by this pull request
@nicolasstucki nicolasstucki marked this pull request as ready for review June 24, 2020 09:02
@nicolasstucki nicolasstucki requested a review from liufengyun June 24, 2020 09:02
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

Otherwise, LGTM

Copy link
Contributor

@allanrenucci allanrenucci left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -146,7 +146,7 @@ class ReplCompiler extends Compiler {
val objectTermName = ctx.source.file.toString.toTermName
objectNames.update(defs.state.objectIndex, objectTermName)

val unit = CompilationUnit(ctx.source)
val unit = new ReplCompilationUnit(ctx.source)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I would use an anonymous class

Suggested change
val unit = new ReplCompilationUnit(ctx.source)
val unit = new CompilationUnit(ctx.source) {
override def isSuspendable: Boolean = false
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to make it possible to identify a REPL compilation unit simply. I remember seeing places where we identify them by the name of the file which we could simplify with this scheme.

@nicolasstucki nicolasstucki merged commit 16a45c4 into scala:master Jun 25, 2020
@nicolasstucki nicolasstucki deleted the fix-#9227 branch June 25, 2020 10:35
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.

Macro MatchError on EmptyTree
3 participants