Skip to content

Commit fe2d9a4

Browse files
committed
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.
1 parent 6bba8f7 commit fe2d9a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/repl/scala/tools/nsc/interpreter/Scripted.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ class WriterOutputStream(writer: Writer) extends OutputStream {
331331
byteBuffer.flip()
332332
val result = decoder.decode(byteBuffer, charBuffer, /*eoi=*/ false)
333333
if (byteBuffer.remaining == 0) byteBuffer.clear()
334-
if (charBuffer.position > 0) {
334+
if (charBuffer.position() > 0) {
335335
charBuffer.flip()
336336
writer write charBuffer.toString
337337
charBuffer.clear()

0 commit comments

Comments
 (0)