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

Comments

Projects
None yet
1 participant
@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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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 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