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

Import Statements don't allow the use of super #9663

Closed
scabug opened this issue Feb 19, 2016 · 2 comments
Closed

Import Statements don't allow the use of super #9663

scabug opened this issue Feb 19, 2016 · 2 comments
Labels

Comments

@scabug
Copy link

scabug commented Feb 19, 2016

Given the following code:

abstract class ScalaTreeTransformer[T, C <: whitebox.Context](val c: C) {
import c.universe._
...
}

class LuaTransformer[C <: whitebox.Context](c: C) extends ScalaTreeTransformerLuaNode,C {
import super.c.universe._ // <-- this line produces a compile error
...
}

The use of a super clause to select the 'c' identifier is a 'Stable Identifier' as defined in the grammar and in an import statement this should be allowable. I don't see why this should be an error. The message given:
Error(x,x) "Identifier given but 'super' found."

@scabug
Copy link
Author

scabug commented Feb 19, 2016

Imported From: https://issues.scala-lang.org/browse/SI-9663?orig=1
Reporter: Cody Ohlsen (codyohl)
Affected Versions: 2.11.7

@scabug
Copy link
Author

scabug commented Mar 7, 2016

@szeiger said:
This is not related to stable identifiers. Per http://www.scala-lang.org/files/archive/spec/2.11/06-expressions.html#this-and-super, "super" is only allowed for methods and types, not for values and variables.

@scabug scabug closed this as completed Mar 7, 2016
@scabug scabug added the typer label Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant