Skip to content

Commit 3e4f166

Browse files
dbtsaiHyukjinKwon
authored andcommitted
[MINOR] Fix Scala 2.12 build
## What changes were proposed in this pull request? [SPARK-25095](ad45299) introduced `ambiguous reference to overloaded definition` ``` [error] /Users/d_tsai/dev/apache-spark/core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:242: ambiguous reference to overloaded definition, [error] both method addTaskCompletionListener in class TaskContext of type [U](f: org.apache.spark.TaskContext => U)org.apache.spark.TaskContext [error] and method addTaskCompletionListener in class TaskContext of type (listener: org.apache.spark.util.TaskCompletionListener)org.apache.spark.TaskContext [error] match argument types (org.apache.spark.TaskContext => Unit) [error] context.addTaskCompletionListener(_ => server.close()) [error] ^ [error] one error found [error] Compile failed at Aug 24, 2018 1:56:06 PM [31.582s] ``` which fails the Scala 2.12 branch build. ## How was this patch tested? Existing tests Closes #22229 from dbtsai/fix-2.12-build. Authored-by: DB Tsai <[email protected]> Signed-off-by: hyukjinkwon <[email protected]>
1 parent 8e64278 commit 3e4f166

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ private[spark] abstract class BasePythonRunner[IN, OUT](
239239
}
240240
// Close ServerSocket on task completion.
241241
serverSocket.foreach { server =>
242-
context.addTaskCompletionListener(_ => server.close())
242+
context.addTaskCompletionListener[Unit](_ => server.close())
243243
}
244244
val boundPort: Int = serverSocket.map(_.getLocalPort).getOrElse(0)
245245
if (boundPort == -1) {

0 commit comments

Comments
 (0)