Skip to content

Fix #4217: display warnings in repl #4269

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
Apr 7, 2018
Merged

Conversation

liufengyun
Copy link
Contributor

Fix #4217: display warnings in repl

@liufengyun liufengyun requested a review from allanrenucci April 6, 2018 14:25
@@ -235,6 +235,9 @@ class ReplDriver(settings: Array[String],
val newImports = newState.imports ++ extractImports(parsed.trees)
val newStateWithImports = newState.copy(imports = newImports)

implicit val ctx: Context = newState.run.runContext
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this implicit context is needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, an implicit State is required.

@@ -235,6 +235,9 @@ class ReplDriver(settings: Array[String],
val newImports = newState.imports ++ extractImports(parsed.trees)
val newStateWithImports = newState.copy(imports = newImports)

implicit val ctx: Context = newState.run.runContext
displayErrors(newState.run.runContext.flushBufferedMessages())
Copy link
Contributor

@allanrenucci allanrenucci Apr 6, 2018

Choose a reason for hiding this comment

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

Can you add a comment saying that this code displays warnings. Otherwise it confusing (the name of the function is misleading).

Copy link
Contributor

Choose a reason for hiding this comment

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

Can that function get renamed a bit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, it's for another PR :)

@liufengyun liufengyun merged commit 08f4679 into scala:master Apr 7, 2018
@liufengyun liufengyun deleted the fix-4217 branch April 7, 2018 07:26
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.

3 participants