Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

';' expected but string literal found. #4785

Closed
scabug opened this issue Jul 10, 2011 · 6 comments
Closed

';' expected but string literal found. #4785

scabug opened this issue Jul 10, 2011 · 6 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Jul 10, 2011

The following code will give the error in the bug's summary if semicolons are missing

def main(args: Array[String]): Unit = {
  """
    x
  """ contains 'x'

  """
    x
  """ contains 'x'
}

However, this will compile:

def main(args: Array[String]): Unit = {
  """
    x
  """ contains 'x'

  """
  """ contains 'x'
}
@scabug
Copy link
Author

scabug commented Jul 10, 2011

Imported From: https://issues.scala-lang.org/browse/SI-4785?orig=1
Reporter: Erkki Lindpere (villane)
Affected Versions: 2.9.0
Other Milestones: 2.10.0
Attachments:

  • Bug.scala (created on Mar 15, 2012 2:28:30 AM UTC, 57 bytes)

@scabug
Copy link
Author

scabug commented Aug 2, 2011

@paulp said:
Consolidating with #4760.

@scabug
Copy link
Author

scabug commented Aug 8, 2011

Commit Message Bot (anonymous) said:
(extempore in r25459) Fix for a bug in CharArrayReader which made triple quoted strings
fail to parse sometimes. Note: when the temptation strikes to adjust
for special cases by letting the regular case happen and subsequently
attempting to fix the ball of mutation by selectively applying what
seems like the inverse operation, please consider the possibility that
this is not the optimal approach. Closes #4785, no review.

@scabug
Copy link
Author

scabug commented Mar 15, 2012

@etorreborre said:
I've add the same issue with the following code and Scala 2.9.1:

package s99

class Test {

  """
  d""" 

  """
  s"""

}

@scabug
Copy link
Author

scabug commented Mar 15, 2012

@etorreborre said:
I'm attaching my exact file because the error disappears sometimes after a copy-and-paste.

I'm guessing that some line feed characters might be an issue (I'm on windows if that helps and I've used Intellij IDEA to create the file. The encoding is UTF-8 I think)

@scabug
Copy link
Author

scabug commented Mar 15, 2012

@paulp said:
It's still fixed, just not in 2.9.1. I backported it to 2.9.x. May not be in 2.9.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants