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
"no-symbol does not have an owner" with Scala 2.10 (named args side effects on trees) #6921
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6921?orig=1
|
David Hotham (dimbleby) said: (It looks as though I'm going to be able to work around this by re-naming the "private[this] var reason" so that it doesn't clash with the reason in Message, which will be just fine for me). sealed abstract class MessageType(val value: Int)
object MessageType {
case object HELLO extends MessageType(0)
}
sealed abstract class Reason(val value: Int)
object Reason {
case object GOOD_REASON extends Reason(0)
}
case class Message(messageType:MessageType, reason:Option[Reason] = None)
class ReproForSI6921 {
private[this] var reason: Reason = Reason.GOOD_REASON
def decideElection() {
val explanation = None
val msg = Message(MessageType.HELLO, reason = explanation)
}
} |
Andreas W (andreasw) said: This looks like a critical error to me. Is anything being done? |
Andreas W (andreasw) said: I need to find a solution ASAP, will look into downgrading the IDE compiler first. [error] no-symbol does not have an owner |
@retronym said: Please open a new ticket. But we will need more data to reproduce it. Firstly, run 'last' in SBT after the compilation crash to show me the full stack trace. That might be enough to see if this is an already-reported issue. The problem was encountered in the file "PlateView.scala". Try to isolate to cut that file down step by step (replace method bodies by |
@retronym said (edited on Mar 6, 2013 6:16:28 AM UTC): Regressed in scala/scala@c800d1fe, "Use context for buffering errors that cannot/shouldn't be reported in…" |
@retronym said: |
@lrytz said: |
@lrytz said: object MessageType {
val HELLO = ""
}
class Message(messageType: String, reason: Option[String])
class ReproForSI6921 {
private[this] var reason = ""
def decideElection {
val explanation = None
new Message(MessageType.HELLO, reason = explanation)
}
} no-symbol does not have an owner
at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:49)
at scala.tools.nsc.Global.abort(Global.scala:254)
at scala.reflect.internal.Symbols$NoSymbol.owner(Symbols.scala:3248)
at scala.tools.nsc.typechecker.SuperAccessors$SuperAccTransformer.hostForAccessorOf(SuperAccessors.scala:548)
at scala.tools.nsc.typechecker.SuperAccessors$SuperAccTransformer.needsProtectedAccessor(SuperAccessors.scala:524)
at scala.tools.nsc.typechecker.SuperAccessors$SuperAccTransformer.mayNeedProtectedAccessor$1(SuperAccessors.scala:162) by reducing it further to the following, the compiler no longer crashes but gives a very strange error message that i haven't seen before: class Message(messageType: String, reason: Option[String])
class ReproForSI6921 {
private[this] var reason = ""
def decideElection = {
val explanation = None
new Message("", reason = explanation)
}
} sandbox/t6921-2.scala:7: error: erroneous or inaccessible type
def decideElection = {
^
one error found |
Andreas W (andreasw) said: My first priority will be to get working again, which means rolling back the IDE to 2.10.0, somehow. With SBT, changing the Scala version to 2.10.0-RC2 fixes the problem. |
Andreas W (andreasw) said: |
Andreas W (andreasw) said: |
@retronym said: What are the downsides of this? Can this introduce other problems? |
@lrytz said: |
@retronym said: |
I'm attempting upgrade from 2.9.2 to 2.10. Code that previously compiled cleanly is now triggering the error "no-symbol does not have an owner" (I'll attach the full output, rather than pasting it in).
I've tried to figure out where the failure was introduced, and I have found that the code compiles successfully at 2.10.0-M1, but the error occurs at 2.10.0-M2.
I don't have a small repro, and I think that I'm not able to share the entire project that hits this problem. I recognise that this is not ideal! I'll play around a bit to see if I can get a smaller repro; if I come up with something that I can share then I will do so. Please advise if there's anything else I can do to help out.
The text was updated successfully, but these errors were encountered: