Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
4.0.0
-
Connect, GraphX, MLlib, Spark Core, SQL
Description
For the code `val symbol = 'symbol`, it's a compile warning in Scala 2.13, but it's a compile error in Scala 3.
- 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 symbol = 'symbol ^ warning: symbol literal is deprecated; use Symbol("symbol") instead [quickfixable] val symbol: Symbol = Symbol(symbol)
- 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 symbol = 'symbol -- Error: ---------------------------------------------------------------------- 1 |val symbol = 'symbol | ^ |symbol literal 'symbol is no longer supported, |use a string literal "symbol" or an application Symbol("symbol") instead, |or enclose in braces '{symbol} if you want a quoted expression. |For now, you can also `import language.deprecated.symbolLiterals` to accept |the idiom, but this possibility might no longer be available in the future.
Attachments
Issue Links
- relates to
-
SPARK-34443 Replace symbol literals with Symbol constructor invocations to comply with Scala 2.13
- In Progress
-
SPARK-38351 [TESTS] Replace 'abc symbols with Symbol("abc") in tests
- Resolved
- links to