Skip to content

Make :settings -deprecation on by default in REPL as beginners get frustrated by incomprehensibly concealed messages #15953

Open
@bjornregnell

Description

@bjornregnell

Compiler version

3.1.3

Minimized code and Output

$ scala
Welcome to Scala 3.1.3 (17.0.4, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                                               
scala> 42D + "hello"
there was 1 deprecation warning; re-run with -deprecation for details
1 warning found
val res0: String = 42.0hello
                                                                                                                               
scala> 

Expectation

Beginners are frustrated by this warning and think it is an error but dont understand why and dont know what deprecation means nor how to re-run, so this is an UX bug IMHO.

:settings -deprecation should be on by default in REPL so that:

scala> 42D + "hello"
1 warning found
-- Deprecation Warning: -------------------------------------------------------------------------------------------------------
1 |42D + "hello"
  |^^^^^
  |method + in class Double is deprecated since 2.13.0: Adding a number and a String is deprecated. Use the string interpolation `s"$num$str"`
val res1: String = 42.0hello

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions