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

"Unexpected tree in genLoad" when compiling a derived actor #5162

Closed
scabug opened this issue Nov 7, 2011 · 5 comments
Closed

"Unexpected tree in genLoad" when compiling a derived actor #5162

scabug opened this issue Nov 7, 2011 · 5 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Nov 7, 2011

Compiling this

abstract class DerivedActor extends scala.actors.Actor {
	override def !? (msg: Any): Any = { super.!?(msg) }
}

results in a java.lang.Error: Unexpected tree in genLoad: DerivedActor.super/class error:

>scalac -d out src/Bugreport.scala
error: java.lang.Error: Unexpected tree in genLoad: DerivedActor.super/class scala.reflect.generic.Trees$Super at: source-src\Bugreport.scala,line-2,offset=95
        at scala.tools.nsc.symtab.SymbolTable.abort(SymbolTable.scala:34)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1126)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadQualifier(GenICode.scala:1175)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:738)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadQualifier(GenICode.scala:1175)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:921)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:114)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:69)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:69)
        at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
        at scala.collection.immutable.List.foreach(List.scala:45)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:69)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:136)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:88)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:69)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:69)
        at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
        at scala.collection.immutable.List.foreach(List.scala:45)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:69)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:79)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:65)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.apply(GenICode.scala:61)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:329)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:297)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:297)
        at scala.collection.Iterator$class.foreach(Iterator.scala:660)
        at scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:316)
        at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:297)
        at scala.tools.nsc.backend.icode.GenICode$ICodePhase.run(GenICode.scala:54)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:953)
        at scala.tools.nsc.Global$Run.compile(Global.scala:1038)
        at scala.tools.nsc.Main$.process(Main.scala:106)
        at scala.tools.nsc.Main$.main(Main.scala:123)
        at scala.tools.nsc.Main.main(Main.scala)
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 7, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5162?orig=1
Reporter: Georg Dietrich (ugdietrich)
Affected Versions: 2.9.1, 2.9.2
Other Milestones: 2.10.0

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 24, 2011

@paulp said:
Regressed in r24749, intended to fix #4283.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 24, 2011

@paulp said:
It's some kind of unexpectedly casted Super tree showing up in icode.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jun 10, 2012

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jun 11, 2012

@scabug scabug closed this Jun 11, 2012
@scabug scabug added the critical label Apr 7, 2017
@scabug scabug added this to the 2.10.0-M3 milestone Apr 7, 2017
lrytz added a commit to lrytz/scala that referenced this issue Jul 4, 2017
A super access to a protected member in a package-protected class is allowed through
an intermediate public class. The fix for scala/bug#5162 actually introduced an error
for this case, because the scala compiler would generate an INVOKESPECIAL with the
package-protected class as receiver, which is illegal. However, we can use the public
intermediate class in the invocation signature.

Fixes scala/bug#7936

This is very similar to scala/bug#4283
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.