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

Specification has wrong syntax summary #5065

Closed
scabug opened this issue Oct 7, 2011 · 4 comments
Closed

Specification has wrong syntax summary #5065

scabug opened this issue Oct 7, 2011 · 4 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Oct 7, 2011

Example for our issue: http://youtrack.jetbrains.net/issue/SCL-3419

package a {
  // Scala plugin reports an error 'Val or var keyword expected' on the parameter 'foo'.
  class Foo(private[a] foo: String)
}

But according to language specification this syntax is illegal:
ClassParam ::= {Annotation} {Modifier} ('val' ) id ':' ParamType ['=' Expr]
So something should be changed (specification or compiler).
I think, that compiler should be changed here because of simple reason, that this modifier has no sense on class parameter.

@scabug
Copy link
Author

scabug commented Oct 7, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5065?orig=1
Reporter: @Alefas
Affected Versions: 2.9.1

@scabug
Copy link
Author

scabug commented May 12, 2012

@soc said:
This is also a bit inconsistent (Scala version 2.10.0-20120511-110655-3511e5960d (OpenJDK 64-Bit Server VM, Java 1.7.0_03)):

package a {
  class Foo(private[a] foo: String)
  class Bar(protected[a] bar: String)
}
% scalac si-5065.scala
si-5065.scala:3: error: 'val' expected but identifier found.
  class Bar(protected[a] bar: String)
                         ^
si-5065.scala:4: error: identifier expected but '}' found.
}
^

At least the error message (and recovery, see second error) needs some fixes.

@scabug
Copy link
Author

scabug commented Oct 15, 2013

@gkossakowski said:
Unassigning and rescheduling to M7 as previous deadline was missed.

@scabug scabug closed this as completed Mar 12, 2014
@scabug
Copy link
Author

scabug commented Mar 12, 2014

@adriaanm said:
Fixed in the markdown spec.

@scabug scabug added this to the 2.11.0-RC3 milestone Apr 7, 2017
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