[
https://issues.apache.org/jira/browse/SPARK-45627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated SPARK-45627:
-----------------------------------
Labels: pull-request-available (was: )
> Fix `symbol literal is deprecated`
> ----------------------------------
>
> Key: SPARK-45627
> URL: https://issues.apache.org/jira/browse/SPARK-45627
> Project: Spark
> Issue Type: Sub-task
> Components: Connect, GraphX, MLlib, Spark Core, SQL
> Affects Versions: 4.0.0
> Reporter: Yang Jie
> Priority: Major
> Labels: pull-request-available
>
> 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
>
> {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> val symbol = 'symbol
> ^
> warning: symbol literal is deprecated; use Symbol("symbol") instead
> [quickfixable]
> val symbol: Symbol = Symbol(symbol) {code}
>
>
> * Scala 3
>
> {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> 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. {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]