在我开始通过 SBT 插件为 Scala 2.10 使用 quasiquotes 后,我收到如下警告:
[warn] embeddedFile--QuasiquoteCompat.scala@e97d744663044acca2f60c8e99547f14:320: Adapting argument list by inserting (): leaky (Object-receiving) target makes this especially dangerous.
[warn] signature: ConstantExtractor.apply(value: Any): Constants.this.Constant
[warn] given arguments: <none>
[warn] after adaptation: ConstantExtractor((): Unit)
[warn] DefDef(NoMods, newTermName("$init$"), List(), List(List()), TypeTree(), u.Block(lvdefs, Literal(Constant())))))
[warn] ^
[warn] embeddedFile--QuasiquoteCompat.scala@e97d744663044acca2f60c8e99547f14:329: Adapting argument list by inserting (): leaky (Object-receiving) target makes this especially dangerous.
[warn] signature: ConstantExtractor.apply(value: Any): Constants.this.Constant
[warn] given arguments: <none>
[warn] after adaptation: ConstantExtractor((): Unit)
[warn] DefDef(constrMods, nme.CONSTRUCTOR, List(), vparamss1, TypeTree(), u.Block(lvdefs ::: List(superCall), Literal(Constant())))))
[warn] ^
如何解释这些警告?
我做错了什么?
我能对它们做些什么?
这在天堂的 2.10.3-RC1 版本中得到了修复。如果您需要使用 2.10.2,请告诉我,我将发布 2.10.2 的更新版本。