Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-45314 Drop Scala 2.12 and make Scala 2.13 by default
  3. SPARK-44407

Clean up the compilation warnings related to `it will become a keyword in Scala 3`

Attach filesAttach ScreenshotVotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.5.0
    • 4.0.0
    • Build

    Description

      [warn] /Users/yangjie01/SourceCode/git/spark-mine-sbt/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/JavaTypeInferenceSuite.scala:74:21: [deprecation @  | origin= | version=2.13.7] Wrap `enum` in backticks to use it as an identifier, it will become a keyword in Scala 3.
      [warn]   @BeanProperty var enum: java.time.Month = _ 

      enum will become a keyword in Scala 3, this also includes export and given.

       

      Scala 2.13

      Welcome to Scala 2.13.12 (OpenJDK 64-Bit Server VM, Java 17.0.8).
      Type in expressions for evaluation. Or try :help.
      
      
      scala> val enum: Int = 1
                 ^
             warning: Wrap `enum` in backticks to use it as an identifier, it will become a keyword in Scala 3. [quickfixable]
      val enum: Int = 1
      
      
      scala> val export: Int = 1
                 ^
             warning: Wrap `export` in backticks to use it as an identifier, it will become a keyword in Scala 3. [quickfixable]
      val export: Int = 1
      
      
      scala> val given: Int = 1
                 ^
             warning: Wrap `given` in backticks to use it as an identifier, it will become a keyword in Scala 3. [quickfixable]
      val given: Int = 1 

       
      Scala 3
       

      Welcome to Scala 3.3.1 (17.0.8, Java OpenJDK 64-Bit Server VM).
      Type in expressions for evaluation. Or try :help.
                                                                                                                                                                                                                                                           
      scala> val enum: Int = 1
      -- [E032] Syntax Error: --------------------------------------------------------
      1 |val enum: Int = 1
        |    ^^^^
        |    pattern expected
        |
        | longer explanation available when compiling with `-explain`
                                                                                                                                                                                                                                                           
      scala> val export: Int = 1
      -- [E032] Syntax Error: --------------------------------------------------------
      1 |val export: Int = 1
        |    ^^^^^^
        |    pattern expected
        |
        | longer explanation available when compiling with `-explain`
                                                                                                                                                                                                                                                           
      scala> val given: Int = 1
      -- [E040] Syntax Error: --------------------------------------------------------
      1 |val given: Int = 1
        |         ^
        |         an identifier expected, but ':' found
        |
        | longer explanation available when compiling with `-explain` 

       
       
       

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            LuciferYang Yang Jie
            LuciferYang Yang Jie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment