2016-09-15 7 views
2

인 IntelliJ이 코드에 대해 불평 그러나 이러한 서명IntelliJ에 오류가 :</p> <pre><code>val document: Node // (initialized further up in the code) val s: String = (new scala.xml.PrettyPrinter(80, 4)).format(document)) </code></pre> <p>오류로 : "같은 서명을 참조 형식을 확인할 수 없습니다"

과 참조 형식을 확인할 수 없습니다 - 같은 함수가 존재합니다. 두 번째 매개 변수의 기본값이 있으며 IntelliJ에서 올바르게 식별하지 못하는 것 같습니다.

답변

1

나는 당신이 언급 한 그 특정한 오류에 대해서는 확신하지 않지만 한 괄호가 너무 많습니다.

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

난 그냥 (내가 그 보정을 만들어 한 번) sbt 당신의 코드를 시도하고 그것을 잘 보인다 :

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

그것은해야한다 : 당신은이

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>