Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Scala 2.7.3
    • Component/s: Misc Compiler
    • Labels:
      None

      Description

      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)
      

        Activity

        Hide
        Eskil added a comment -

        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)
        
        Show
        Eskil added a comment - 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)
        Hide
        Iulian Dragos added a comment -

        Hopefully, this time..

        Show
        Iulian Dragos added a comment - Hopefully, this time..

          People

          • Assignee:
            Iulian Dragos
            Reporter:
            Eskil
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development