Details

    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

          Activity

            People

              panbingkun BingKun Pan
              LuciferYang Yang Jie
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: