-
Notifications
You must be signed in to change notification settings - Fork 92
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
ConstructingParser throws NoSuchMethodError in Scala 3 #541
Comments
I'm able to reproduce the problem locally in the Scala 3 REPL. Once we dig into this it seems like it has to ultimately be a Scala 3 bug rather than something we did wrong in this repo. Regardless, we need this scala-xml ticket anyway because we'll need to publish a new version of the library once there's a compiler fix. |
Next step would be to |
minimized (not sure the string is absolutely minimal, but it doesn't matter, we just want something short that triggers it) @Test
def issue541: Unit = {
val xml =
"""|<script>// <![CDATA[
|[]; // ]]>
|</script>""".stripMargin
val parser = ConstructingParser.fromSource(Source.fromString(xml), preserveWS = true)
parser.document().docElem // shouldn't crash
} |
I've reported the Scala 3 compiler bug responsible over at scala/scala3#13096 Here in this repo, I will submit a pull request with a workaround. |
PR: #542 |
fixed in 2.0.1 which is now published |
Save https://horstmann.com/unblog/2020-11-27/index.html to a local file and run
In Scala 2, this works perfectly. In Scala 3.0.0, an exception is thrown:
The offending code is
The library dependency in
build.sbt
:The text was updated successfully, but these errors were encountered: