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

Quasiquotes parse val (x: Int) = 1 differently from default parser #8202

Closed
scabug opened this issue Jan 29, 2014 · 6 comments
Closed

Quasiquotes parse val (x: Int) = 1 differently from default parser #8202

scabug opened this issue Jan 29, 2014 · 6 comments

Comments

@scabug
Copy link

scabug commented Jan 29, 2014

scala> toolbox.parse("val (x: int) = 2")
res0: toolbox.u.Tree = val x: int = 2

scala> q"val (x: int) = 2"
res1: reflect.runtime.universe.ValDef =
val x: int = 2: @scala.unchecked match {
  case (x @ (_: int)) => x
}

Interestingly enough quasiquote's version looks much more reasonable to me.

@scabug
Copy link
Author

scabug commented Jan 29, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8202?orig=1
Reporter: @densh
Affected Versions: 2.11.0-M8
See #900

@scabug
Copy link
Author

scabug commented Jan 29, 2014

@retronym said:
See: #900

@scabug
Copy link
Author

scabug commented Feb 10, 2014

@densh said:
@adriaanm, the inconsistency is fixed in scala/scala#3455

@scabug
Copy link
Author

scabug commented Feb 10, 2014

@adriaanm said:
Oh, I guess I got confused. So, the PR fixes the parsing, but type checking is unaffected?

@scabug
Copy link
Author

scabug commented Feb 10, 2014

@densh said (edited on Feb 10, 2014 8:06:40 PM UTC):
This PR fixes quasiquotes by making them treat q"val (x: T) = v" the same as q"val x: T = v" (i.e. compile-time check). The primary parser stays unchanged but now both of them will agree on this matter even though it will stay broken in 2.11.

densh/scala@a8a7f4a

Change to the Scala parser scheduled for 2.12 is a different bug: #8211.

@scabug
Copy link
Author

scabug commented Feb 20, 2014

@densh said:
scala/scala#3455

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