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

Quasiquote fails to match block within a block in some situations #8489

Closed
scabug opened this issue Apr 9, 2014 · 2 comments
Closed

Quasiquote fails to match block within a block in some situations #8489

scabug opened this issue Apr 9, 2014 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Apr 9, 2014

Following snippet doesn't match even though it should:

val q"""
  var $$tmpscope: _root_.scala.xml.NamespaceBinding = $$scope
  $$tmpscope = new _root_.scala.xml.NamespaceBinding($prefix, $uri, $$tmpscope)
  {
    val $$scope: _root_.scala.xml.NamespaceBinding = $$tmpscope
    ..$last
  }
""" = q"""<foo xmlns="bar"/>"""

Workaround:

val q"""
 var $$tmpscope: _root_.scala.xml.NamespaceBinding = $$scope
 $$tmpscope = new _root_.scala.xml.NamespaceBinding($prefix, $uri, $$tmpscope)
 ${build.SyntacticBlock(q"val $$scope: _root_.scala.xml.NamespaceBinding = $$tmpscope":: last)}
""" = q"""<foo xmlns="bar"/>"""
@scabug
Copy link
Author

scabug commented Apr 9, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8489?orig=1
Reporter: @densh
Affected Versions: 2.11.0-RC4

@scabug
Copy link
Author

scabug commented Jul 2, 2014

@densh said:
Actually the problem here is lack of line between assignment and the block that follows it. So instead of having a 3 statement block you get 2 statements. This is not a bug.

@scabug scabug closed this as completed Jul 2, 2014
@scabug scabug added this to the 2.11.0 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants