本文介绍了警告:scalac:有一个过时警告;使用-deprecation重新运行以获取详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在消息输出中注意这一点:

Notice this in the message output:

这是什么意思?我应该重新运行什么?

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

我尝试重建和同步项目.但是警告消息仍然存在.

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

推荐答案

从命令行找到了解决方案:

Found a solution from command line:

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

并找到警告的原因:

[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

问题是我使用了不推荐使用的函数调用logger.error().奇怪的是IntelliJ没有给出任何皮棉错误.

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

参考: https://stackoverflow.com/a/9578787/1035008

这篇关于警告:scalac:有一个过时警告;使用-deprecation重新运行以获取详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 23:39