-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can that function get renamed a bit? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, it's for another PR :) |
||
|
||
displayDefinitions(unit.tpdTree, newestWrapper)(newStateWithImports) | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
scala> def foo(x: Option[Int]) = x match { case None => } | ||
1 | def foo(x: Option[Int]) = x match { case None => } | ||
| ^ | ||
| match may not be exhaustive. | ||
| | ||
| It would fail on pattern case: Some(_) | ||
def foo(x: Option[Int]): Unit |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.