Scala Programming Language
  1. Scala Programming Language
  2. SI-7242

scala.reflect.internal.Types$TypeError: ambiguous reference to overloaded definition

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.9.2, Scala 2.10.0, Scala 2.10.1-RC3, Scala 2.10.1
    • Fix Version/s: Scala 2.10.2-RC1
    • Component/s: None

      Description

      I got the following compiler crash when compiling some code which I'm unfortunately not able to reduce to a simple reproducible example. Hopefully the information is helpful still. (I can provide a GitHub project with crashable code if needed.)

      [error]
      [error]      while compiling: E:\prog\jvm\lib\Allegretto\allegretto\src\test\sca
      la\no\allegretto\test\feature\PKTestTables.scala
      [error]         during phase: explicitouter
      [error]      library version: version 2.10.1-RC3
      [error]     compiler version: version 2.10.1-RC3
      [error]   reconstructed args: -bootclasspath C:\Program Files\Java\jdk1.7.0_13\j
      re\lib\resources.jar;C:\Program Files\Java\jdk1.7.0_13\jre\lib\rt.jar;C:\Program
       Files\Java\jdk1.7.0_13\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.7.0_13
      \jre\lib\jsse.jar;C:\Program Files\Java\jdk1.7.0_13\jre\lib\jce.jar;C:\Program F
      iles\Java\jdk1.7.0_13\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.7.0_13\jre
      \lib\jfr.jar;C:\Program Files\Java\jdk1.7.0_13\jre\classes;C:\Users\Knut Arne Ve
      daa\.sbt\boot\scala-2.10.1-RC3\lib\scala-library.jar -d E:\prog\jvm\lib\Allegret
      to\allegretto\target\scala-2.10\test-classes -classpath E:\prog\jvm\lib\Allegret
      to\allegretto\target\scala-2.10\test-classes;E:\prog\jvm\lib\Allegretto\allegret
      to\target\scala-2.10\classes;C:\Users\Knut Arne Vedaa\.ivy2\cache\com.h2database
      \h2\jars\h2-1.3.170.jar;C:\Users\Knut Arne Vedaa\.ivy2\cache\org.scalatest\scala
      test_2.10\jars\scalatest_2.10-1.9.1.jar;C:\Users\Knut Arne Vedaa\.ivy2\cache\org
      .scala-lang\scala-actors\jars\scala-actors-2.10.0.jar;C:\Users\Knut Arne Vedaa\.
      ivy2\cache\org.scala-lang\scala-reflect\jars\scala-reflect-2.10.0.jar
      [error]
      [error]   last tree to typer: TypeTree
      [error]               symbol: null
      [error]    symbol definition: null
      [error]        symbol owners:
      [error]       context owners: value $outer -> object PKTestTable -> trait PKTest
      Tables -> package feature
      [error]
      [error] == Enclosing template or block ==
      [error]
      [error] Template( // val <local PKTestTable>: <notype> in object PKTestTable, tr
      ee.tpe=PKTestTables.this.PKTestTable.type
      [error]   "no.allegretto.SchemaLike.Table", "no.allegretto.test.feature.PKTestTa
      bles.PKTestTable" // parents
      [error]   ValDef(
      [error]     private
      [error]     "_"
      [error]     <tpt>
      [error]     <empty>
      [error]   )
      [error]   DefDef( // def <init>(): PKTestTables.this.PKTestTable.type in object
      PKTestTable
      [error]     <method> <triedcooking>
      [error]     "<init>"
      [error]     []
      [error]     List(Nil)
      [error]     <tpt> // tree.tpe=PKTestTables.this.PKTestTable.type
      [error]     Block( // tree.tpe=Unit
      [error]       Apply( // def <init>(name: String): SchemaLike.this.Table in class
       Table, tree.tpe=PKTestTables.this.Table
      [error]         PKTestTable.super."<init>" // def <init>(name: String): SchemaLi
      ke.this.Table in class Table, tree.tpe=(name: String)PKTestTables.this.Table
      [error]         "PKTestTable"
      [error]       )
      [error]       ()
      [error]     )
      [error]   )
      [error] )
      [error]
      [error] uncaught exception during compilation: scala.reflect.internal.Types$Type
      Error
      [trace] Stack trace suppressed: run last test:compile for the full output.
      [error] (test:compile) scala.reflect.internal.Types$TypeError: ambiguous referen
      ce to overloaded definition,
      [error] both value $outer in object PKTestTable of type ()no.allegretto.<refinem
      ent>.type
      [error] and  value $outer in object PKTestTable of type ()no.allegretto.test.fea
      ture.PKTestTables
      [error] match expected type ?
      

        Issue Links

          Activity

          Hide
          Jason Zaugg added a comment -

          I can't reproduce the crash with that repository with either 2.10.0 or 2.10.1-RC3.

          Getting Scala 2.10.1-RC3 ...
          downloading http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.10.1-RC3/scala-compiler-2.10.1-RC3.jar ...
          	[SUCCESSFUL ] org.scala-lang#scala-compiler;2.10.1-RC3!scala-compiler.jar (3555ms)
          downloading http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.1-RC3/scala-library-2.10.1-RC3.jar ...
          	[SUCCESSFUL ] org.scala-lang#scala-library;2.10.1-RC3!scala-library.jar (1171ms)
          downloading http://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.10.1-RC3/scala-reflect-2.10.1-RC3.jar ...
          	[SUCCESSFUL ] org.scala-lang#scala-reflect;2.10.1-RC3!scala-reflect.jar (409ms)
          downloading http://repo1.maven.org/maven2/org/scala-lang/jline/2.10.1-RC3/jline-2.10.1-RC3.jar ...
          	[SUCCESSFUL ] org.scala-lang#jline;2.10.1-RC3!jline.jar (283ms)
          :: retrieving :: org.scala-sbt#boot-scala
          	confs: [default]
          	5 artifacts copied, 0 already retrieved (24386kB/38ms)
          [info] Updating {file:/Users/jason/code/allegretto/}default-d735bb...
          [info] Resolving org.scala-lang#scala-reflect;2.10.0 ...
          [info] Done updating.
          [info] Compiling 47 Scala sources to /Users/jason/code/allegretto/target/scala-2.10/classes...
          [info] 'compiler-interface' not yet compiled for Scala 2.10.1-RC3. Compiling...
          [info]   Compilation completed in 10.751 s
          [warn] there were 50 feature warning(s); re-run with -feature for details
          [warn] one warning found
          [success] Total time: 28 s, completed Mar 12, 2013 10:31:34 PM
          > package
          [info] Packaging /Users/jason/code/allegretto/target/scala-2.10/allegretto_2.10-0.3-SNAPSHOT.jar ...
          [info] Done packaging.
          [success] Total time: 0 s, completed Mar 12, 2013 10:32:27 PM
          > eval "git branch -v" !
          * 0.3    d84dad1 crashes compiler (simpler example)
            master b234b60 m
          

          Could please post a transcript that shows how to reproduce?

          Show
          Jason Zaugg added a comment - I can't reproduce the crash with that repository with either 2.10.0 or 2.10.1-RC3. Getting Scala 2.10.1-RC3 ... downloading http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.10.1-RC3/scala-compiler-2.10.1-RC3.jar ... [SUCCESSFUL ] org.scala-lang#scala-compiler;2.10.1-RC3!scala-compiler.jar (3555ms) downloading http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.1-RC3/scala-library-2.10.1-RC3.jar ... [SUCCESSFUL ] org.scala-lang#scala-library;2.10.1-RC3!scala-library.jar (1171ms) downloading http://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.10.1-RC3/scala-reflect-2.10.1-RC3.jar ... [SUCCESSFUL ] org.scala-lang#scala-reflect;2.10.1-RC3!scala-reflect.jar (409ms) downloading http://repo1.maven.org/maven2/org/scala-lang/jline/2.10.1-RC3/jline-2.10.1-RC3.jar ... [SUCCESSFUL ] org.scala-lang#jline;2.10.1-RC3!jline.jar (283ms) :: retrieving :: org.scala-sbt#boot-scala confs: [default] 5 artifacts copied, 0 already retrieved (24386kB/38ms) [info] Updating {file:/Users/jason/code/allegretto/}default-d735bb... [info] Resolving org.scala-lang#scala-reflect;2.10.0 ... [info] Done updating. [info] Compiling 47 Scala sources to /Users/jason/code/allegretto/target/scala-2.10/classes... [info] 'compiler-interface' not yet compiled for Scala 2.10.1-RC3. Compiling... [info] Compilation completed in 10.751 s [warn] there were 50 feature warning(s); re-run with -feature for details [warn] one warning found [success] Total time: 28 s, completed Mar 12, 2013 10:31:34 PM > package [info] Packaging /Users/jason/code/allegretto/target/scala-2.10/allegretto_2.10-0.3-SNAPSHOT.jar ... [info] Done packaging. [success] Total time: 0 s, completed Mar 12, 2013 10:32:27 PM > eval "git branch -v" ! * 0.3 d84dad1 crashes compiler (simpler example) master b234b60 m Could please post a transcript that shows how to reproduce?
          Hide
          Jason Zaugg added a comment -

          Oh, I see, test:compile is needed.

          Show
          Jason Zaugg added a comment - Oh, I see, test:compile is needed.
          Hide
          Jason Zaugg added a comment -

          Minimized:

          class CrashTest {
            trait CrashTestTable {
              def cols = 1
            }
            object CrashTestTable extends CrashTestTable
          }
          
          Show
          Jason Zaugg added a comment - Minimized: class CrashTest { trait CrashTestTable { def cols = 1 } object CrashTestTable extends CrashTestTable }
          Show
          Jason Zaugg added a comment - https://github.com/scala/scala/pull/2245
          Hide
          Paul Phillips added a comment -

          We should really figure a way not to duplicate this much effort. I didn't squander most of my 30s minimizing bugs in the hopes of becoming the Van Gogh or Kafka of scala issues, unknown in my own time, not to be celebrated until shortly after my early demise. "Wow, look at all this stuff!"

          Show
          Paul Phillips added a comment - We should really figure a way not to duplicate this much effort. I didn't squander most of my 30s minimizing bugs in the hopes of becoming the Van Gogh or Kafka of scala issues, unknown in my own time, not to be celebrated until shortly after my early demise. "Wow, look at all this stuff!"

            People

            • Assignee:
              Jason Zaugg
              Reporter:
              Knut Arne Vedaa
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development