Skip to content

Extends syntax inconsistent #902

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

Closed
scabug opened this issue May 13, 2008 · 4 comments
Closed

Extends syntax inconsistent #902

scabug opened this issue May 13, 2008 · 4 comments

Comments

@scabug
Copy link

scabug commented May 13, 2008

In the syntax summary of the Scala Specification (as of May 5th, 2008), the syntax for subclassing is given as:

ClassTemplateOpt ::= Extends ClassTemplate | [[Extends] TemplateBody]
TraitTemplateOpt ::= Extends TraitTemplate | [[Extends] TemplateBody]
Extends          ::= `extends' | `<:'

However, the alternative <: token doesn't seem to be supported by the compiler. Moreover, the Extends non-terminal is not mentioned elsewhere in the specification, and in 5.3 we have

ClassTemplateOpt ::= `extends' ClassTemplate | [[`extends'] TemplateBody]
TraitTemplateOpt ::= `extends' TraitTemplate | [[`extends'] TemplateBody]

Hence the syntax summary seems to be erroneous.

@scabug
Copy link
Author

scabug commented May 13, 2008

Imported From: https://issues.scala-lang.org/browse/SI-902?orig=1
Reporter: Lauri Alanko (lealanko)

@scabug
Copy link
Author

scabug commented May 13, 2008

Geoffrey Alan Washburn (washburn) said:
The token <: can be used in some cases in trunk, though the semantics are completely undefined until virtual classes are implemented.

@scabug
Copy link
Author

scabug commented May 13, 2008

Lauri Alanko (lealanko) said:
Quite right. A braino on my part to forget virtual classes.

However, I'd still say that, in a reference document linked to from the Scala site's front page, it is a bad idea to describe a syntax that is not supported by the current release version, and that is not explained in detail anywhere in the specification.

If the May 5th version of the spec is a "work in progress", not even supposed to be a coherent text, or consistent with any release of the implementation, then I think it should be listed under "nightly builds" or the like.

Yes, granted, it does say "draft", but it also says "version 2.7", strongly indicating that it's somehow related to the language supported by the 2.7.x series of the implementation.

@scabug
Copy link
Author

scabug commented Jan 14, 2009

@odersky said:
Milestone next_bugfix deleted

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

1 participant