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

Problem using static inner classes #1329

Closed
scabug opened this issue Sep 8, 2008 · 3 comments
Closed

Problem using static inner classes #1329

scabug opened this issue Sep 8, 2008 · 3 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Sep 8, 2008

Outer.java:

public class Outer {
  //public enum EnumFoo { Bar }
  public static class Foo {
    public static Foo Bar = new Foo();
  }
}

Scala:

scala> Outer.Foo.Bar
error: error while loading Foo, class file '.\Outer$$Foo.class' is broken
(class Outer not found.)
<console>:5: error: value Bar is not a member of object Outer.Foo
       Outer.Foo.Bar

Using an enum from Qt Jambi:

scala> import com.trolltech.qt.gui.QDialogButtonBox.StandardButton
import com.trolltech.qt.gui.QDialogButtonBox.StandardButton

scala> StandardButton.Cancel
Exception in thread "main" java.lang.AssertionError: assertion failed: type error: can't convert from REFERENCE(com.trolltech.qt.gui.QDialogButtonBox$$StandardButton) to REFERENCE(com.trolltech.qt.gui.QDialogButtonBox$$StandardButton) in unit
 <console>
        at scala.Predef$$.assert(Predef.scala:92)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.adapt(GenICode.scala:1035)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:1019)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genStat(GenICode.scala:171)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase$$$$anonfun$$genStat$$1.apply(GenICode.scala:146)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase$$$$anonfun$$genStat$$1.apply(GenICode.scala:145)
        at scala.List.foreach(List.scala:834)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.genStat(GenICode.scala:145)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:938)
        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:71)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase$$$$anonfun$$gen$$1.apply(GenICode.scala:71)
        at scala.List.foreach(List.scala:834)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:71)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:136)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:90)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase$$$$anonfun$$gen$$1.apply(GenICode.scala:71)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase$$$$anonfun$$gen$$1.apply(GenICode.scala:71)
        at scala.List.foreach(List.scala:834)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:71)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:81)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:67)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.apply(GenICode.scala:63)
        at scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:268)
        at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:247)
        at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:247)
        at scala.Iterator$$class.foreach(Iterator.scala:414)
        at scala.collection.mutable.ListBuffer$$$$anon$$1.foreach(ListBuffer.scala:266)
        at scala.tools.nsc.Global$$GlobalPhase.run(Global.scala:247)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.run(GenICode.scala:56)
        at scala.tools.nsc.Global$$Run.compileSources(Global.scala:579)
        at scala.tools.nsc.Interpreter$$Request.compile(Interpreter.scala:823)
        at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:505)
        at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:494)
        at scala.tools.nsc.InterpreterLoop.interpretStartingWith(InterpreterLoop.scala:242)
        at scala.tools.nsc.InterpreterLoop.command(InterpreterLoop.scala:230)
        at scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:142)
        at scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:298)
        at scala.tools.nsc.MainGenericRunner$$.main(MainGenericRunner.scala:150)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Sep 8, 2008

Imported From: https://issues.scala-lang.org/browse/SI-1329?orig=1
Reporter: Eskil (eskil)

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Sep 9, 2008

Eskil (eskil) said:
Enums are still broken:

public class Outer {
  public enum Foo { Bar }
}
scala> Outer.Foo.Bar
Exception in thread "main" java.lang.AssertionError: assertion failed: type error: can't convert from REFERENCE(Outer$$Foo) to REFERENCE(Outer$$Foo) in unit <cons
ole>
        at scala.Predef$$.assert(Predef.scala:92)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.adapt(GenICode.scala:1035)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:1019)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genStat(GenICode.scala:171)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase$$$$anonfun$$genStat$$1.apply(GenICode.scala:146)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase$$$$anonfun$$genStat$$1.apply(GenICode.scala:145)
        at scala.List.foreach(List.scala:834)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.genStat(GenICode.scala:145)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:938)
        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:71)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase$$$$anonfun$$gen$$1.apply(GenICode.scala:71)
        at scala.List.foreach(List.scala:834)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:71)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:136)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:90)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase$$$$anonfun$$gen$$1.apply(GenICode.scala:71)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase$$$$anonfun$$gen$$1.apply(GenICode.scala:71)
        at scala.List.foreach(List.scala:834)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:71)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:81)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.gen(GenICode.scala:67)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.apply(GenICode.scala:63)
        at scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:268)
        at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:247)
        at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:247)
        at scala.Iterator$$class.foreach(Iterator.scala:414)
        at scala.collection.mutable.ListBuffer$$$$anon$$1.foreach(ListBuffer.scala:266)
        at scala.tools.nsc.Global$$GlobalPhase.run(Global.scala:247)
        at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.run(GenICode.scala:56)
        at scala.tools.nsc.Global$$Run.compileSources(Global.scala:579)
        at scala.tools.nsc.Interpreter$$Request.compile(Interpreter.scala:823)
        at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:505)
        at scala.tools.nsc.Interpreter.interpret(Interpreter.scala:494)
        at scala.tools.nsc.InterpreterLoop.interpretStartingWith(InterpreterLoop.scala:242)
        at scala.tools.nsc.InterpreterLoop.command(InterpreterLoop.scala:230)
        at scala.tools.nsc.InterpreterLoop.repl(InterpreterLoop.scala:142)
        at scala.tools.nsc.InterpreterLoop.main(InterpreterLoop.scala:298)
        at scala.tools.nsc.MainGenericRunner$$.main(MainGenericRunner.scala:150)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Sep 12, 2008

@dragos said:
Hopefully, this time..

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.