2016-09-15 3 views
2

IntelliJのは、このコード文句:エラーでIntelliJのエラー:「などのシグネチャを持つ参照形式を解決することはできません」

val document: Node // (initialized further up in the code) 
val s: String = (new scala.xml.PrettyPrinter(80, 4)).format(document)) 

を: は、しかし、そのような署名で

を参照形式を解決できません - など関数が存在する。 2番目のパラメータの既定値があり、IntelliJが正しく識別していないようです。

答えて

1

あなたが言及したその特定のエラーについてはわかりませんが、括弧が多すぎます。あなたは持っている:

val s: String = (new scala.xml.PrettyPrinter(80, 4)).format(document)) 

それは次のようになります。

val s: String = (new scala.xml.PrettyPrinter(80, 4)).format(document) 

(私はその補正をした後に)私はちょうどsbtであなたのコードを試してみました、それは罰金だ:

scala> import scala.xml._ 
import scala.xml._ 

scala> val document : Node = <test>blah</test> 
document: scala.xml.Node = <test>blah</test> 

scala> val s: String = (new PrettyPrinter(80, 4)).format(document) 
s: String = <test>blah</test> 
関連する問題