Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-10165

Adding s interpolator makes String literal parsing fail

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: Scala 2.11.8
    • Fix Version/s: None
    • Component/s: Compiler (Misc)
    • Labels:

      Description

      1. Start with a valid string literal which compiles.
      2. Prefix with s
      3. The compilation then fails

      scala> val N = "00"
      N: String = 00
       
      scala> "\"N\" : \"$N\""
      res1: String = "N" : "$N"
       
      scala> s"\"N\" : \"$N\""
      <console>:1: error: ';' expected but string literal found.
      s"\"N\" : \"$N\""
            ^
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                janekdb Janek Bogucki
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: