[ https://issues.apache.org/jira/browse/SPARK-45610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17777396#comment-17777396 ]
Yang Jie commented on SPARK-45610: ---------------------------------- In Spark, this involves a massive amount of cases. Since this is a compile error for Scala 3, it seems that we will have to fix this when we prepare to support Scala 3. As the plan to support Scala 3 is not clear at the moment, should we wait until the schedule for supporting Scala 3 is confirmed before we proceed with the fix? I would like to know your thoughts. [~srowen] [~dongjoon] [~gurwls223] > Handle "Auto-application to `()` is deprecated." > ------------------------------------------------ > > Key: SPARK-45610 > URL: https://issues.apache.org/jira/browse/SPARK-45610 > Project: Spark > Issue Type: Sub-task > Components: GraphX, MLlib, Spark Core, SQL, Structured Streaming > Affects Versions: 4.0.0 > Reporter: Yang Jie > Priority: Major > > For the following case, a compile warning will be issued in Scala 2.13: > > {code:java} > Welcome to Scala 2.13.12 (OpenJDK 64-Bit Server VM, Java 17.0.8). > Type in expressions for evaluation. Or try :help. > scala> class Foo { > | def isEmpty(): Boolean = true > | def isTrue(x: Boolean): Boolean = x > | } > class Foo > scala> val foo = new Foo > val foo: Foo = Foo@7061622 > scala> val ret = foo.isEmpty > ^ > warning: Auto-application to `()` is deprecated. Supply the empty > argument list `()` explicitly to invoke method isEmpty, > or remove the empty argument list from its definition (Java-defined > methods are exempt). > In Scala 3, an unapplied method like this will be eta-expanded into a > function. [quickfixable] > val ret: Boolean = true {code} > But for Scala 3, it is a compile error: > {code:java} > Welcome to Scala 3.3.1 (17.0.8, Java OpenJDK 64-Bit Server VM). > Type in expressions for evaluation. Or try :help. > > > > > scala> class Foo { > | def isEmpty(): Boolean = true > | def isTrue(x: Boolean): Boolean = x > | } > // defined class Foo > > > > > scala> val foo = new Foo > val foo: Foo = Foo@591f6f83 > > > > > scala> val ret = foo.isEmpty > -- [E100] Syntax Error: > -------------------------------------------------------- > 1 |val ret = foo.isEmpty > | ^^^^^^^^^^^ > | method isEmpty in class Foo must be called with () argument > | > | longer explanation available when compiling with `-explain` > 1 error found {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org