这条线将导致编译错误:如何在Scala中打印出标准错误的字符串列表?
astgen.typeError.foreach(System.err.println)
类型错误是一个字符串对象中的一个astgen scala.collection.immutable.List。
我得到的错误是:
error: ambiguous reference to overloaded definition,
both method println in class PrintStream of type (java.lang.String)Unit
and method println in class PrintStream of type (Array[Char])Unit
match expected type (Nothing) => Unit
astgen.typeError.foreach(System.err.println)
我是新来的Scala和不理解的问题。使用2.7.7final。
我可以重现该问题在2.9.1版本。你正在使用哪个版本?你在谈论Scala的List或Java? – pedrofurla
你应该考虑升级,2.7.7是历史性的。此问题已在更新的版本中修复。 – soc
Ops,我的意思是我无法在2.9.1中重现问题。确实@soc是对的,2.7.7是旧石器时代。 – pedrofurla