LuciferYang commented on code in PR #48192:
URL: https://github.com/apache/spark/pull/48192#discussion_r1773187350


##########
project/SparkBuild.scala:
##########
@@ -250,7 +250,10 @@ object SparkBuild extends PomBuild {
         // reduce the cost of migration in subsequent versions.
         "-Wconf:cat=deprecation&msg=it will become a keyword in Scala 3:e",
         // SPARK-46938 to prevent enum scan on pmml-model, under spark-mllib 
module.
-        "-Wconf:cat=other&site=org.dmg.pmml.*:w"
+        "-Wconf:cat=other&site=org.dmg.pmml.*:w",
+        // Some deprecated calls is a compilation error in Scala 2.13.15.
+        
"-Wconf:cat=deprecation&msg=^(?=.*?method|value|object|trait|class|constructor)(?=.*?in)(?=.*?deprecated).+$:w",

Review Comment:
   - Scala 2.13.14 with `-Wconf:cat=deprecation:wv,any:e`,  printed a `warning` 
message for the use of deprecated API
   
   ```scala
   ~/Tools/scala-2.13.14/bin/scala -Wconf:cat=deprecation:wv,any:e
   Welcome to Scala 2.13.14 (OpenJDK 64-Bit Server VM, Java 17.0.12).
   Type in expressions for evaluation. Or try :help.
   
   scala> class Foo {
        |   def isEmpty(): Boolean = true
        | }
   class Foo
   
   scala> val foo = new Foo
   val foo: Foo = Foo@706ddbc8
   
   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]
          Applicable -Wconf / @nowarn filters for this warning: msg=<part of 
the message>, cat=deprecation, site=ret, version=2.13.3
   val ret: Boolean = true
   ```
   
   -  Scala 2.13.15 with `-Wconf:cat=deprecation:wv,any:e`,  printed a `error` 
message for the use of deprecated API
   
   ```scala
   ~/Tools/scala-2.13.15/bin/scala -Wconf:cat=deprecation:wv,any:e
   Welcome to Scala 2.13.15 (OpenJDK 64-Bit Server VM, Java 17.0.12).
   Type in expressions for evaluation. Or try :help.
   
   scala> class Foo {
        |   def isEmpty(): Boolean = true
        | }
   class Foo
   
   scala> val foo = new Foo
   val foo: Foo = Foo@53f0d09c
   
   scala> val ret = foo.isEmpty
                        ^
          error: 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]
          Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part 
of the message>, cat=deprecation, site=ret, version=2.13.3
   ```
   
   friendly ping @SethTisue Is this a change that was intentionally introduced 
in Scala 2.13.15?
   
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to