2
這對編譯斯卡拉2.8.0最終沒有錯誤:從斯卡拉中調用Java:受保護的構造
import javax.swing.tree.TreePath
object A extends Application {
val path1 = new TreePath()
val path2 = new TreePath(path1, "foo")
}
然而,在執行我得到:
java.lang.IllegalAccessError: tried to access method javax.swing.tree.TreePath.<init>()V from class A$
at A$.<init>(A.scala:5)
at A$.<clinit>(A.scala)
at A.main(A.scala)
這是一個bug,功能,或一個已知的限制?