summaryrefslogtreecommitdiff
path: root/src/repl
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2017-02-16 15:45:00 +1000
committerJason Zaugg <jzaugg@gmail.com>2017-02-16 21:48:33 +1000
commitfe2d9a431ada04f18197e2bad5cbaa94667ef0b3 (patch)
treea6d3d757b4a59685406b093dc58507589023f229 /src/repl
parent6bba8f7168b870b53f459d716566cfa46b0a5174 (diff)
downloadscala-fe2d9a431ada04f18197e2bad5cbaa94667ef0b3.tar.gz
scala-fe2d9a431ada04f18197e2bad5cbaa94667ef0b3.tar.bz2
scala-fe2d9a431ada04f18197e2bad5cbaa94667ef0b3.zip
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 <console>: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.
Diffstat (limited to 'src/repl')
-rw-r--r--src/repl/scala/tools/nsc/interpreter/Scripted.scala2
1 files changed, 1 insertions, 1 deletions
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()