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

Possibility to enable things like "-deprecation" without restarting #4594

Closed
scabug opened this issue May 15, 2011 · 6 comments
Closed

Possibility to enable things like "-deprecation" without restarting #4594

scabug opened this issue May 15, 2011 · 6 comments

Comments

@scabug
Copy link

scabug commented May 15, 2011

= problem =
It is annoying to restart the REPL just to see some deprecation message, especially when there is already some amount of code evaluated.

= analysis =
There should be some way to activate things like "-migration", "-deprecation" without having to restart the REPL, maybe via some REPL command (those starting with ":").

= enhancement recommendation =
Add something like that.

@scabug
Copy link
Author

scabug commented May 15, 2011

Imported From: https://issues.scala-lang.org/browse/SI-4594?orig=1
Reporter: @soc

@scabug
Copy link
Author

scabug commented May 16, 2011

@retronym said:
There is already a way, although it's not well publicized.

scala> case class A
warning: there were 1 deprecation warnings; re-run with -deprecation for details
defined class A

scala> :power
** Power User mode enabled - BEEP BOOP WHIR **
** scala.tools.nsc._ has been imported      **
** global._ and definitions._ also imported **
** New vals! Try repl, intp, global, power  **
** New cmds! :help to discover them         **
** New defs! Type power.<tab> to reveal     **

scala> settings.deprecation.value = true

scala> case class A
<console>:1: warning: case classes without a parameter list have been deprecated;
use either case objects or case classes with `()' as parameter list.
       case class A
                   ^

Migration:

scala> settings.Xmigration28.value = true

scala> Iterator.empty.collect { case x => x }
<console>:22: warning: method collect in trait Iterator has changed semantics:
This collect implementation bears no relationship to the one before 2.8.
The previous behavior can be reproduced with toSeq.
       Iterator.empty.collect { case x => x }
                      ^
res0: Iterator[Nothing] = empty iterator

@scabug
Copy link
Author

scabug commented May 16, 2011

@soc said:
Would it be possible to have shortcurts for it, like
:deprecation, : migration
and changing the warning messages to point to them?

@scabug
Copy link
Author

scabug commented Aug 9, 2011

Commit Message Bot (anonymous) said:
(extempore in r25467) Don't discard deprecation/unchecked warnings regardless of settings.

Changed warnings code to accumulate them rather than thoughtlessly
discarding them and issuing its well-known taunt. In the repl you
can take advantage of this with the :warnings command, which will show
the suppressed warnings from the last line which had any. Be advised
that at the moment it has some issues: unchecked warnings aren't
making it out, and near repl startup neither are deprecation warnings,
so don't open a bunch of tickets please.

References #4594, no review.

@scabug
Copy link
Author

scabug commented Jul 8, 2013

@som-snytt said:
scala/scala#2701

@scabug scabug closed this as completed Jul 10, 2013
@scabug
Copy link
Author

scabug commented Jul 10, 2013

@adriaanm said:
scala/scala#2701

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants