From fe2d9a431ada04f18197e2bad5cbaa94667ef0b3 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 16 Feb 2017 15:45:00 +1000 Subject: Avoid ambiguous overload on JDK 9 The addition of this method in `CharBuffer` CharBuffer position(int newPosition) renders an ambiguity in: ``` scala> (b: java.nio.CharBuffer) => b.position :12: error: ambiguous reference to overloaded definition, both method position in class CharBuffer of type (x$1: Int)java.nio.CharBuffer and method position in class Buffer of type ()Int match expected type ? (b: java.nio.CharBuffer) => b.position ``` Manually applying the empty params avoids this. --- src/repl/scala/tools/nsc/interpreter/Scripted.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/repl') diff --git a/src/repl/scala/tools/nsc/interpreter/Scripted.scala b/src/repl/scala/tools/nsc/interpreter/Scripted.scala index 6aef486957..8d87d98e53 100644 --- a/src/repl/scala/tools/nsc/interpreter/Scripted.scala +++ b/src/repl/scala/tools/nsc/interpreter/Scripted.scala @@ -331,7 +331,7 @@ class WriterOutputStream(writer: Writer) extends OutputStream { byteBuffer.flip() val result = decoder.decode(byteBuffer, charBuffer, /*eoi=*/ false) if (byteBuffer.remaining == 0) byteBuffer.clear() - if (charBuffer.position > 0) { + if (charBuffer.position() > 0) { charBuffer.flip() writer write charBuffer.toString charBuffer.clear() -- cgit v1.2.3