Fangchen Li created SPARK-58043:
-----------------------------------

             Summary: Use explicit .apply instead of a case class companion as 
a function
                 Key: SPARK-58043
                 URL: https://issues.apache.org/jira/browse/SPARK-58043
             Project: Spark
          Issue Type: Sub-task
          Components: Spark Core
    Affects Versions: 4.3.0
            Reporter: Fangchen Li


In Scala 2, a case class's companion object extends FunctionN, so the bare 
companion can be passed where a function is expected (xs.map(Foo), 
reduceLeft(And)). Scala 3 removed this, so such call sites fail to compile. 
Replacing Foo with Foo.apply (the method that FunctionN forwarded to) is 
byte-identical in Scala 2.13 and compiles on both versions. Affects 190 call 
sites across catalyst/sql-core/hive/sql-api.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to