Yuchen
Yuchen

Reputation: 33116

Warning:scalac: there was one deprecation warning; re-run with -deprecation for details

Notice this in the message output:

Warning:scalac: there was one deprecation warning; re-run with -deprecation for details

enter image description here

What does this mean? And what should I re-run?

I tried rebuilding and syncing the project. But the warning message is still there.

Upvotes: 2

Views: 1637

Answers (1)

Yuchen
Yuchen

Reputation: 33116

Found a solution from command line:

sbt
set scalacOptions in ThisBuild ++= Seq("-unchecked", "-deprecation")
compile

And found the cause of the warning:

[warn] Blah.scala:53: Adaptation of argument list by inserting () has been deprecated: leaky (Object-receiving) target makes this especially dangerous.
[warn]         signature: Logger.error(x$1: Any): Unit
[warn]   given arguments: <none>
[warn]  after adaptation: Logger.error((): Unit)
[warn]       logger.error()
[warn]                   ^
[warn] one warning found

The problem is that I used a deprecated function call logger.error(). It is weird that IntelliJ does not give any lint error though.

Reference: https://stackoverflow.com/a/9578787/1035008

Upvotes: 3

Related Questions