question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scala 3 repl does not show if a message is an error or a warning (regression from scala 2)

See original GitHub issue

Compiler version

3.0.0

Minimized code and output

scala> val x = if true then 42
1 |val x = if true then 42
  |                     ^^
  |A pure expression does nothing in statement position; you may be omitting necessary parentheses

scala> val x = val
1 |val x = val
  |        ^^^
  |        expression expected but val found

Expectation

The first message above should include warning and the the second should include error. It is conceptually important to understand if the code has run or not, esp. for learners but also for professionals - I don’t know all messages by hart if they are warnings or errors. Now it all looks the same in the Scala 3 REPL.

This is a regression from the Scala 2 REPL, in which you can always tell if a message is an error or a warning.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:27 (26 by maintainers)

github_iconTop GitHub Comments

3reactions
bjornregnellcommented, Jul 2, 2021

All tests pass in CI build. 🥳

1reaction
bjornregnellcommented, Jul 2, 2021

@bishabosha Found it: compiler/test/dotty/tools/repl/ShadowingTests.scala

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scala 3 REPL commands · Issue #131 - GitHub
Background Per our discussion, the Scala 2.13 REPL has these commands: scala> :help All commands ... I can't determine if dotr has any...
Read more >
Configuring and suppressing warnings in Scala
In projects where the build log shows a lot of warnings that are mostly ignored, new helpful warnings can easily go undetected.
Read more >
Ammonite REPL
The goal of Ammonite is to liberate your Scala code from heavyweight "projects", using the lightweight Ammonite runtime: if you want to run...
Read more >
Release Notes · Airframe - wvlet.github.io
Upgrade to Scala 2.13.10 to address a regression in Scala 2.13.9. ... This version shows warning messages if you are still using public...
Read more >
Blog · mdoc - javadoc.io
Fast typechecked markdown documentation with clear error messages ... Unlike tut, mdoc does not use the Scala REPL to evaluate Scala code examples....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found