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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

Copy link

scabug commented May 15, 2011

@scabug

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

scabug commented Jul 8, 2013

@scabug scabug closed this Jul 10, 2013

@scabug

This comment has been minimized.

Copy link

scabug commented Jul 10, 2013

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