A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.scala-lang.org/scala3/reference/dropped-features/symlits.html below:

Dropped: Symbol Literals

Edit this page on GitHub Dropped: Symbol Literals

Symbol literals are no longer supported.

The scala.Symbol class still exists, so a literal translation of the symbol literal 'xyz is Symbol("xyz"). However, it is recommended to use a plain string literal "xyz" instead. (The Symbol class will be deprecated and removed in the future). Example:

scalac Test.scala
-- Error: Test.scala:1:25 ------------------------------------------------------------------------------------------------

1 |@main def test = println('abc)
  |                         ^
  |                         symbol literal 'abc is no longer supported,
  |                         use a string literal "abc" or an application Symbol("abc") instead,
  |                         or enclose in braces '{abc} 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.
1 error found

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4