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

Backend fails compilation when a class referenced in a signature of a previously compiled superclass is absent from classpath #275

Closed
retronym opened this issue Nov 24, 2016 · 4 comments
Milestone

Comments

@retronym
Copy link
Member

retronym commented Nov 24, 2016

// ==> sandbox/A.scala <==

package p1 {
  class LeaveMe
  package p2 {
    package p3 {
      class DeleteMe
    }
  }
}


// ==> sandbox/B.scala <==
package sample

class Test {
  final class Inner extends A2 {
    @inline def foo = 42
  }

  def test = new Inner().foo
}
% scalac -version
Scala compiler version 2.12.0 -- Copyright 2002-2016, LAMP/EPFL and Lightbend, Inc.

% scalac sandbox/A.scala && rm -rf p1/p2 && scalac sandbox/B.scala
error: missing or invalid dependency detected while loading class file 'A1.class'.
Could not access term p2 in package p1,
because it (or its dependencies) are missing. Check your build definition for
missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
A full rebuild may help if 'A1.class' was compiled against an incompatible version of p1.
one error found

This is the root cause of wix-incubator/accord#84

The unpickler does not create a stub symbol in nestedObjectSymbol when owner is itself a stub symbol.

        def nestedObjectSymbol: Symbol = {
          // If the owner is overloaded (i.e. a method), it's not possible to select the
          // right member, so return NoSymbol. This can only happen when unpickling a tree.
          // the "case Apply" in readTree() takes care of selecting the correct alternative
          //  after parsing the arguments.
          if (owner.isOverloaded)
            return NoSymbol

          if (tag == EXTMODCLASSref) {
            val moduleVar = owner.info.decl(nme.moduleVarName(name.toTermName))
            if (moduleVar.isLazyAccessor)
              return moduleVar.lazyAccessor.lazyAccessor
          }
          NoSymbol
        }

Contrast this with the code just above

        def fromName(name: Name) = name.toTermName match {
          case nme.ROOT     => loadingMirror.RootClass
          case nme.ROOTPKG  => loadingMirror.RootPackage
          case _            =>
            val decl = owner match {
              case stub: StubSymbol => NoSymbol // SI-8502 Don't call .info and fail the stub
              case _ => owner.info.decl(name)
            }
            adjust(decl)
        }

Relatedly, the backend could be more robust in the face of these errors with:

⚡ git diff -U1 -- /Users/jz/code/scala/src/compiler/scala/tools/nsc/backend/jvm/BCodeAsmCommon.scala
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeAsmCommon.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeAsmCommon.scala
index 93f5159..e151728 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeAsmCommon.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeAsmCommon.scala
@@ -364,3 +364,3 @@ final class BCodeAsmCommon[G <: Global](val global: G) {
   def completeSilentlyAndCheckErroneous(sym: Symbol): Boolean = {
-    if (sym.hasCompleteInfo) false
+    if (sym.validTo == currentPeriod && sym.hasCompleteInfo) false
     else {
"pool-15-thread-10@18997" prio=5 tid=0xa5 nid=NA runnable
  java.lang.Thread.State: RUNNABLE
	  at scala.reflect.internal.Reporter.error(Reporting.scala:82)
	  at scala.reflect.internal.Reporting$class.globalError(Reporting.scala:67)
	  at scala.reflect.internal.SymbolTable.globalError(SymbolTable.scala:16)
	  at scala.reflect.internal.Reporting$class.globalError(Reporting.scala:53)
	  at scala.reflect.internal.SymbolTable.globalError(SymbolTable.scala:16)
	  at scala.reflect.internal.Symbols$StubSymbol$class.fail(Symbols.scala:3479)
	  at scala.reflect.internal.Symbols$StubSymbol$class.info(Symbols.scala:3492)
	  at scala.reflect.internal.Symbols$StubTermSymbol.info(Symbols.scala:3498)
	  at scala.reflect.internal.Symbols$StubTermSymbol.info(Symbols.scala:3498)
	  at scala.reflect.internal.pickling.UnPickler$Scan.scala$reflect$internal$pickling$UnPickler$Scan$$nestedObjectSymbol$1(UnPickler.scala:230)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readExtSymbol$1(UnPickler.scala:258)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readSymbol(UnPickler.scala:284)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readSymbolRef(UnPickler.scala:649)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readExtSymbol$1(UnPickler.scala:207)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readSymbol(UnPickler.scala:284)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readSymbolRef(UnPickler.scala:649)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readExtSymbol$1(UnPickler.scala:207)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readSymbol(UnPickler.scala:284)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readSymbolRef(UnPickler.scala:649)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readThisType$1(UnPickler.scala:398)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:413)
	  at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:658)
	  at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:658)
	  at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:179)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readTypeRef(UnPickler.scala:658)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:417)
	  at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:658)
	  at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:658)
	  at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:179)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readTypeRef(UnPickler.scala:658)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:417)
	  at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:658)
	  at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:658)
	  at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:179)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readTypeRef(UnPickler.scala:658)
	  at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:420)
	  at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef$$anonfun$6.apply(UnPickler.scala:725)
	  at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef$$anonfun$6.apply(UnPickler.scala:725)
	  at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:179)
	  at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.completeInternal(UnPickler.scala:725)
	  at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.complete(UnPickler.scala:749)
	  at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.load(UnPickler.scala:752)
	  at scala.reflect.internal.Symbols$Symbol.typeParams(Symbols.scala:1733)
	  at scala.tools.nsc.transform.SpecializeTypes$$anonfun$scala$tools$nsc$transform$SpecializeTypes$$normalizeMember$1.apply(SpecializeTypes.scala:830)
	  at scala.tools.nsc.transform.SpecializeTypes$$anonfun$scala$tools$nsc$transform$SpecializeTypes$$normalizeMember$1.apply(SpecializeTypes.scala:830)
	  at scala.reflect.internal.SymbolTable.enteringPhase(SymbolTable.scala:235)
	  at scala.tools.nsc.transform.SpecializeTypes.scala$tools$nsc$transform$SpecializeTypes$$normalizeMember(SpecializeTypes.scala:829)
	  at scala.tools.nsc.transform.SpecializeTypes$$anonfun$23.apply(SpecializeTypes.scala:783)
	  at scala.tools.nsc.transform.SpecializeTypes$$anonfun$23.apply(SpecializeTypes.scala:781)
	  at scala.collection.immutable.List.flatMap(List.scala:327)
	  at scala.tools.nsc.transform.SpecializeTypes.specializeClass(SpecializeTypes.scala:781)
	  at scala.tools.nsc.transform.SpecializeTypes.transformInfo(SpecializeTypes.scala:1196)
	  at scala.tools.nsc.transform.InfoTransform$Phase$$anon$1.transform(InfoTransform.scala:38)
	  at scala.reflect.internal.Symbols$Symbol.rawInfo(Symbols.scala:1604)
	  at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1524)
	  at scala.reflect.internal.Types$TypeRef.thisInfo(Types.scala:2194)
	  at scala.reflect.internal.Types$TypeRef.baseClasses(Types.scala:2199)
	  at scala.reflect.internal.Types$class.computeBaseClasses(Types.scala:1439)
	  at scala.reflect.internal.SymbolTable.computeBaseClasses(SymbolTable.scala:16)
	  at scala.reflect.internal.Types$$anonfun$defineBaseClassesOfCompoundType$1.apply(Types.scala:1560)
	  at scala.reflect.internal.Types$$anonfun$defineBaseClassesOfCompoundType$1.apply(Types.scala:1560)
	  at scala.reflect.internal.Types$CompoundType.memo(Types.scala:1393)
	  at scala.reflect.internal.Types$class.defineBaseClassesOfCompoundType(Types.scala:1560)
	  at scala.reflect.internal.Types$class.define$1(Types.scala:1527)
	  at scala.reflect.internal.Types$class.defineBaseClassesOfCompoundType(Types.scala:1528)
	  at scala.reflect.internal.SymbolTable.defineBaseClassesOfCompoundType(SymbolTable.scala:16)
	  at scala.reflect.internal.Types$CompoundType.baseClasses(Types.scala:1370)
	  at scala.reflect.internal.Types$$anonfun$defineBaseClassesOfCompoundType$2.apply(Types.scala:1560)
	  at scala.reflect.internal.Types$$anonfun$defineBaseClassesOfCompoundType$2.apply(Types.scala:1560)
	  at scala.reflect.internal.Types$CompoundType.memo(Types.scala:1393)
	  at scala.reflect.internal.Types$class.defineBaseClassesOfCompoundType(Types.scala:1560)
	  at scala.reflect.internal.Types$class.define$1(Types.scala:1527)
	  at scala.reflect.internal.Types$class.defineBaseClassesOfCompoundType(Types.scala:1528)
	  at scala.reflect.internal.SymbolTable.defineBaseClassesOfCompoundType(SymbolTable.scala:16)
	  at scala.reflect.internal.Types$CompoundType.baseClasses(Types.scala:1370)
	  at scala.reflect.internal.Types$PolyType.baseClasses(Types.scala:2509)
	  at scala.reflect.internal.Types$TypeRef.baseClasses(Types.scala:2199)
	  at scala.reflect.internal.Types$class.computeBaseClasses(Types.scala:1439)
	  at scala.reflect.internal.SymbolTable.computeBaseClasses(SymbolTable.scala:16)
	  at scala.reflect.internal.Types$$anonfun$defineBaseClassesOfCompoundType$1.apply(Types.scala:1560)
	  at scala.reflect.internal.Types$$anonfun$defineBaseClassesOfCompoundType$1.apply(Types.scala:1560)
	  at scala.reflect.internal.Types$CompoundType.memo(Types.scala:1393)
	  at scala.reflect.internal.Types$class.defineBaseClassesOfCompoundType(Types.scala:1560)
	  at scala.reflect.internal.Types$class.define$1(Types.scala:1527)
	  at scala.reflect.internal.Types$class.defineBaseClassesOfCompoundType(Types.scala:1528)
	  at scala.reflect.internal.SymbolTable.defineBaseClassesOfCompoundType(SymbolTable.scala:16)
	  at scala.reflect.internal.Types$CompoundType.baseClasses(Types.scala:1370)
	  at scala.reflect.internal.Types$$anonfun$defineBaseClassesOfCompoundType$2.apply(Types.scala:1560)
	  at scala.reflect.internal.Types$$anonfun$defineBaseClassesOfCompoundType$2.apply(Types.scala:1560)
	  at scala.reflect.internal.Types$CompoundType.memo(Types.scala:1393)
	  at scala.reflect.internal.Types$class.defineBaseClassesOfCompoundType(Types.scala:1560)
	  at scala.reflect.internal.Types$class.define$1(Types.scala:1527)
	  at scala.reflect.internal.Types$class.defineBaseClassesOfCompoundType(Types.scala:1528)
	  at scala.reflect.internal.SymbolTable.defineBaseClassesOfCompoundType(SymbolTable.scala:16)
	  at scala.reflect.internal.Types$CompoundType.baseClasses(Types.scala:1370)
	  at scala.reflect.internal.Types$PolyType.baseClasses(Types.scala:2509)
	  at scala.reflect.internal.Types$TypeRef.baseClasses(Types.scala:2199)
	  at scala.reflect.internal.Types$class.computeBaseClasses(Types.scala:1439)
	  at scala.reflect.internal.SymbolTable.computeBaseClasses(SymbolTable.scala:16)
	  at scala.reflect.internal.Types$$anonfun$defineBaseClassesOfCompoundType$1.apply(Types.scala:1560)
	  at scala.reflect.internal.Types$$anonfun$defineBaseClassesOfCompoundType$1.apply(Types.scala:1560)
	  at scala.reflect.internal.Types$CompoundType.memo(Types.scala:1393)
	  at scala.reflect.internal.Types$class.defineBaseClassesOfCompoundType(Types.scala:1560)
	  at scala.reflect.internal.Types$class.define$1(Types.scala:1527)
	  at scala.reflect.internal.Types$class.defineBaseClassesOfCompoundType(Types.scala:1528)
	  at scala.reflect.internal.SymbolTable.defineBaseClassesOfCompoundType(SymbolTable.scala:16)
	  at scala.reflect.internal.Types$CompoundType.baseClasses(Types.scala:1370)
	  at scala.reflect.internal.Types$$anonfun$defineBaseClassesOfCompoundType$2.apply(Types.scala:1560)
	  at scala.reflect.internal.Types$$anonfun$defineBaseClassesOfCompoundType$2.apply(Types.scala:1560)
	  at scala.reflect.internal.Types$CompoundType.memo(Types.scala:1393)
	  at scala.reflect.internal.Types$class.defineBaseClassesOfCompoundType(Types.scala:1560)
	  at scala.reflect.internal.Types$class.define$1(Types.scala:1527)
	  at scala.reflect.internal.Types$class.defineBaseClassesOfCompoundType(Types.scala:1528)
	  at scala.reflect.internal.SymbolTable.defineBaseClassesOfCompoundType(SymbolTable.scala:16)
	  at scala.reflect.internal.Types$CompoundType.baseClasses(Types.scala:1370)
	  at scala.reflect.internal.Types$PolyType.baseClasses(Types.scala:2509)
	  at scala.reflect.internal.Symbols$Symbol.ancestors(Symbols.scala:2129)
	  at scala.reflect.internal.Symbols$Symbol.mixinClasses(Symbols.scala:2125)
	  at scala.tools.nsc.transform.ExplicitOuter.transformInfo(ExplicitOuter.scala:184)
	  at scala.tools.nsc.transform.ExplicitOuter.transformInfo(ExplicitOuter.scala:200)
	  at scala.tools.nsc.transform.InfoTransform$Phase$$anon$1.transform(InfoTransform.scala:38)
	  at scala.reflect.internal.Symbols$Symbol.rawInfo(Symbols.scala:1604)
	  at scala.reflect.internal.Symbols$Symbol.hasCompleteInfo(Symbols.scala:1568)
	  at scala.tools.nsc.backend.jvm.BCodeAsmCommon.completeSilentlyAndCheckErroneous(BCodeAsmCommon.scala:365)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:116)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:112)
	  at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
	  at scala.collection.concurrent.TrieMap.getOrElse(TrieMap.scala:633)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:112)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.buildNestedInfo(BTypesFromSymbols.scala:395)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.scala$tools$nsc$backend$jvm$BTypesFromSymbols$$setClassInfo(BTypesFromSymbols.scala:351)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:120)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:112)
	  at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
	  at scala.collection.concurrent.TrieMap.getOrElse(TrieMap.scala:633)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:112)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$primitiveOrClassToBType$1$2.apply(BTypesFromSymbols.scala:153)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$primitiveOrClassToBType$1$2.apply(BTypesFromSymbols.scala:153)
	  at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
	  at scala.collection.AbstractMap.getOrElse(Map.scala:59)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.primitiveOrClassToBType$1(BTypesFromSymbols.scala:153)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.typeToBType(BTypesFromSymbols.scala:168)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.methodBTypeFromSymbol(BTypesFromSymbols.scala:133)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$buildFromSymbol$1$2.apply(BTypesFromSymbols.scala:431)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$buildFromSymbol$1$2.apply(BTypesFromSymbols.scala:431)
	  at scala.tools.nsc.backend.jvm.BCodeAsmCommon$$anonfun$9.apply(BCodeAsmCommon.scala:406)
	  at scala.tools.nsc.backend.jvm.BCodeAsmCommon$$anonfun$9.apply(BCodeAsmCommon.scala:397)
	  at scala.collection.Iterator$$anon$12.nextCur(Iterator.scala:434)
	  at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:440)
	  at scala.collection.Iterator$class.foreach(Iterator.scala:893)
	  at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
	  at scala.collection.TraversableOnce$class.toMap(TraversableOnce.scala:316)
	  at scala.collection.AbstractIterator.toMap(Iterator.scala:1336)
	  at scala.tools.nsc.backend.jvm.BCodeAsmCommon.buildInlineInfoFromClassSymbol(BCodeAsmCommon.scala:448)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.buildFromSymbol$1(BTypesFromSymbols.scala:431)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.buildInlineInfo(BTypesFromSymbols.scala:436)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.scala$tools$nsc$backend$jvm$BTypesFromSymbols$$setClassInfo(BTypesFromSymbols.scala:353)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:120)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:112)
	  at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
	  at scala.collection.concurrent.TrieMap.getOrElse(TrieMap.scala:633)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:112)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$14.apply(BTypesFromSymbols.scala:349)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$14.apply(BTypesFromSymbols.scala:349)
	  at scala.collection.immutable.List.map(List.scala:277)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.scala$tools$nsc$backend$jvm$BTypesFromSymbols$$setClassInfo(BTypesFromSymbols.scala:349)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:120)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:112)
	  at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
	  at scala.collection.concurrent.TrieMap.getOrElse(TrieMap.scala:633)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:112)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$primitiveOrClassToBType$1$2.apply(BTypesFromSymbols.scala:153)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$primitiveOrClassToBType$1$2.apply(BTypesFromSymbols.scala:153)
	  at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
	  at scala.collection.AbstractMap.getOrElse(Map.scala:59)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.primitiveOrClassToBType$1(BTypesFromSymbols.scala:153)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.typeToBType(BTypesFromSymbols.scala:168)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$methodBTypeFromSymbol$2.apply(BTypesFromSymbols.scala:134)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$methodBTypeFromSymbol$2.apply(BTypesFromSymbols.scala:134)
	  at scala.collection.immutable.List.map(List.scala:273)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.methodBTypeFromSymbol(BTypesFromSymbols.scala:134)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$buildFromSymbol$1$2.apply(BTypesFromSymbols.scala:431)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$buildFromSymbol$1$2.apply(BTypesFromSymbols.scala:431)
	  at scala.tools.nsc.backend.jvm.BCodeAsmCommon$$anonfun$9.apply(BCodeAsmCommon.scala:406)
	  at scala.tools.nsc.backend.jvm.BCodeAsmCommon$$anonfun$9.apply(BCodeAsmCommon.scala:397)
	  at scala.collection.Iterator$$anon$12.nextCur(Iterator.scala:434)
	  at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:440)
	  at scala.collection.Iterator$class.foreach(Iterator.scala:893)
	  at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
	  at scala.collection.TraversableOnce$class.toMap(TraversableOnce.scala:316)
	  at scala.collection.AbstractIterator.toMap(Iterator.scala:1336)
	  at scala.tools.nsc.backend.jvm.BCodeAsmCommon.buildInlineInfoFromClassSymbol(BCodeAsmCommon.scala:448)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.buildFromSymbol$1(BTypesFromSymbols.scala:431)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.buildInlineInfo(BTypesFromSymbols.scala:436)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.scala$tools$nsc$backend$jvm$BTypesFromSymbols$$setClassInfo(BTypesFromSymbols.scala:353)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:120)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:112)
	  at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
	  at scala.collection.concurrent.TrieMap.getOrElse(TrieMap.scala:633)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:112)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$14.apply(BTypesFromSymbols.scala:349)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$14.apply(BTypesFromSymbols.scala:349)
	  at scala.collection.immutable.List.map(List.scala:277)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.scala$tools$nsc$backend$jvm$BTypesFromSymbols$$setClassInfo(BTypesFromSymbols.scala:349)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:120)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:112)
	  at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
	  at scala.collection.concurrent.TrieMap.getOrElse(TrieMap.scala:633)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:112)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$primitiveOrClassToBType$1$2.apply(BTypesFromSymbols.scala:153)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$primitiveOrClassToBType$1$2.apply(BTypesFromSymbols.scala:153)
	  at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
	  at scala.collection.AbstractMap.getOrElse(Map.scala:59)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.primitiveOrClassToBType$1(BTypesFromSymbols.scala:153)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.typeToBType(BTypesFromSymbols.scala:168)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$methodBTypeFromSymbol$2.apply(BTypesFromSymbols.scala:134)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$methodBTypeFromSymbol$2.apply(BTypesFromSymbols.scala:134)
	  at scala.collection.immutable.List.map(List.scala:273)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.methodBTypeFromSymbol(BTypesFromSymbols.scala:134)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$buildFromSymbol$1$2.apply(BTypesFromSymbols.scala:431)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$buildFromSymbol$1$2.apply(BTypesFromSymbols.scala:431)
	  at scala.tools.nsc.backend.jvm.BCodeAsmCommon$$anonfun$9.apply(BCodeAsmCommon.scala:406)
	  at scala.tools.nsc.backend.jvm.BCodeAsmCommon$$anonfun$9.apply(BCodeAsmCommon.scala:397)
	  at scala.collection.Iterator$$anon$12.nextCur(Iterator.scala:434)
	  at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:440)
	  at scala.collection.Iterator$class.foreach(Iterator.scala:893)
	  at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
	  at scala.collection.TraversableOnce$class.toMap(TraversableOnce.scala:316)
	  at scala.collection.AbstractIterator.toMap(Iterator.scala:1336)
	  at scala.tools.nsc.backend.jvm.BCodeAsmCommon.buildInlineInfoFromClassSymbol(BCodeAsmCommon.scala:448)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.buildFromSymbol$1(BTypesFromSymbols.scala:431)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.buildInlineInfo(BTypesFromSymbols.scala:436)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.scala$tools$nsc$backend$jvm$BTypesFromSymbols$$setClassInfo(BTypesFromSymbols.scala:353)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:120)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:112)
	  at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
	  at scala.collection.concurrent.TrieMap.getOrElse(TrieMap.scala:633)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:112)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$14.apply(BTypesFromSymbols.scala:349)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$14.apply(BTypesFromSymbols.scala:349)
	  at scala.collection.immutable.List.map(List.scala:277)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.scala$tools$nsc$backend$jvm$BTypesFromSymbols$$setClassInfo(BTypesFromSymbols.scala:349)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:120)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:112)
	  at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
	  at scala.collection.concurrent.TrieMap.getOrElse(TrieMap.scala:633)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:112)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$primitiveOrClassToBType$1$2.apply(BTypesFromSymbols.scala:153)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$primitiveOrClassToBType$1$2.apply(BTypesFromSymbols.scala:153)
	  at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
	  at scala.collection.AbstractMap.getOrElse(Map.scala:59)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.primitiveOrClassToBType$1(BTypesFromSymbols.scala:153)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.typeToBType(BTypesFromSymbols.scala:168)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$methodBTypeFromSymbol$2.apply(BTypesFromSymbols.scala:134)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$methodBTypeFromSymbol$2.apply(BTypesFromSymbols.scala:134)
	  at scala.collection.immutable.List.map(List.scala:273)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.methodBTypeFromSymbol(BTypesFromSymbols.scala:134)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$buildFromSymbol$1$2.apply(BTypesFromSymbols.scala:431)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$buildFromSymbol$1$2.apply(BTypesFromSymbols.scala:431)
	  at scala.tools.nsc.backend.jvm.BCodeAsmCommon$$anonfun$9.apply(BCodeAsmCommon.scala:406)
	  at scala.tools.nsc.backend.jvm.BCodeAsmCommon$$anonfun$9.apply(BCodeAsmCommon.scala:397)
	  at scala.collection.Iterator$$anon$12.nextCur(Iterator.scala:434)
	  at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:440)
	  at scala.collection.Iterator$class.foreach(Iterator.scala:893)
	  at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
	  at scala.collection.TraversableOnce$class.toMap(TraversableOnce.scala:316)
	  at scala.collection.AbstractIterator.toMap(Iterator.scala:1336)
	  at scala.tools.nsc.backend.jvm.BCodeAsmCommon.buildInlineInfoFromClassSymbol(BCodeAsmCommon.scala:448)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.buildFromSymbol$1(BTypesFromSymbols.scala:431)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.buildInlineInfo(BTypesFromSymbols.scala:436)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.scala$tools$nsc$backend$jvm$BTypesFromSymbols$$setClassInfo(BTypesFromSymbols.scala:353)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:120)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:112)
	  at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
	  at scala.collection.concurrent.TrieMap.getOrElse(TrieMap.scala:633)
	  at scala.tools.nsc.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:112)
	  at scala.tools.nsc.backend.jvm.BCodeHelpers$BCInnerClassGen$class.getClassBTypeAndRegisterInnerClass(BCodeHelpers.scala:344)
	  at scala.tools.nsc.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.getClassBTypeAndRegisterInnerClass(BCodeSkelBuilder.scala:50)
	  at scala.tools.nsc.backend.jvm.BCodeHelpers$BCInnerClassGen$class.internalName(BCodeHelpers.scala:333)
	  at scala.tools.nsc.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.internalName(BCodeSkelBuilder.scala:50)
	  at scala.tools.nsc.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.genPlainClass(BCodeSkelBuilder.scala:103)
	  at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase$Worker1.visit(GenBCode.scala:188)
	  at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase$Worker1$$anonfun$run$1.apply$mcV$sp(GenBCode.scala:137)
	  at scala.tools.nsc.Global$GlobalPhase.withCurrentUnit(Global.scala:431)
	  at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase$Worker1.run(GenBCode.scala:137)
	  at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.buildAndSendToDisk(GenBCode.scala:357)
	  at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.run(GenBCode.scala:326)
	  at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1501)
	  at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1486)
	  at scala.tools.nsc.Global$Run.compileSources(Global.scala:1481)
	  at scala.tools.nsc.Global$Run.compile(Global.scala:1582)
	  at xsbt.CachedCompiler0.run(CompilerInterface.scala:116)
	  at xsbt.CachedCompiler0.run(CompilerInterface.scala:95)
	  - locked <0x4c6b> (a xsbt.CachedCompiler0)
	  at xsbt.CompilerInterface.run(CompilerInterface.scala:26)
	  at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1)
	  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	  at java.lang.reflect.Method.invoke(Method.java:498)
	  at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:107)
	  at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:53)
	  at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:47)
	  at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply$mcV$sp(MixedAnalyzingCompiler.scala:50)
	  at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:50)
	  at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:50)
	  at sbt.compiler.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:74)
	  at sbt.compiler.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:49)
	  at sbt.compiler.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:64)
	  at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
	  at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
	  at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:66)
	  at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:64)
	  at sbt.inc.IncrementalCommon.cycle(IncrementalCommon.scala:32)
	  at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:72)
	  at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:71)
	  at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:99)
	  at sbt.inc.Incremental$.compile(Incremental.scala:71)
	  at sbt.inc.IncrementalCompile$.apply(Compile.scala:54)
	  at sbt.compiler.IC$.compileInternal(IncrementalCompiler.scala:160)
	  at sbt.compiler.IC$.incrementalCompile(IncrementalCompiler.scala:138)
	  at sbt.Compiler$.compile(Compiler.scala:155)
	  at sbt.Compiler$.compile(Compiler.scala:141)
	  at sbt.Defaults$.sbt$Defaults$$compileIncrementalTaskImpl(Defaults.scala:879)
	  at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:870)
	  at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:868)
	  at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
	  at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
	  at sbt.std.Transform$$anon$4.work(System.scala:63)
	  at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
	  at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
	  at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
	  at sbt.Execute.work(Execute.scala:237)
	  at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
	  at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
	  at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
	  at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
	  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	  at java.lang.Thread.run(Thread.java:745)

@retronym
Copy link
Member Author

The stack trace above is from the error in the wild. It seems my minimization isn't faithful, it crashes in Refchecks

@retronym
Copy link
Member Author

retronym commented Nov 24, 2016

Here's a correct repro:

// A.scala
package sample {

  class A1 {
    def irrelevant: p1.p2.p3.DeleteMe = null
  }
  object A1 {
    class A1_Inner
  }
}

package p1 {
  class LeaveMe
  package p2 {
    package p3 {
      class DeleteMe
    }
  }
}
// B.scala
package sample

class Test {
  final class Inner extends A1.A1_Inner {
    def foo = 42
  }

  def test = new Inner().foo
}
qscalac sandbox/A.scala && rm -rf p1/p2 && qscalac -Ydebug  sandbox/B.scala
[running phase parser on B.scala]
[running phase namer on B.scala]
[running phase packageobjects on B.scala]
[running phase typer on B.scala]
[running phase patmat on B.scala]
[running phase superaccessors on B.scala]
[running phase extmethods on B.scala]
[running phase pickler on B.scala]
[running phase refchecks on B.scala]
[running phase uncurry on B.scala]
[running phase fields on B.scala]
[running phase tailcalls on B.scala]
[running phase specialize on B.scala]
[running phase explicitouter on B.scala]
[running phase erasure on B.scala]
[running phase posterasure on B.scala]
[running phase lambdalift on B.scala]
[running phase constructors on B.scala]
[running phase flatten on B.scala]
[running phase mixin on B.scala]
[running phase cleanup on B.scala]
[running phase delambdafy on B.scala]
[running phase jvm on B.scala]
warning: !!! creating stub symbol to defer error: missing or invalid dependency detected while loading class file 'A1.class'.
Could not access term p2 in package class p1,
because it (or its dependencies) are missing. Check your build definition for
missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
A full rebuild may help if 'A1.class' was compiled against an incompatible version of p1.
error: missing or invalid dependency detected while loading class file 'A1.class'.
Could not access term p2 in package class p1,
because it (or its dependencies) are missing. Check your build definition for
missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
A full rebuild may help if 'A1.class' was compiled against an incompatible version of p1.
java.lang.Throwable
        at scala.reflect.internal.Symbols$StubSymbol.fail(Symbols.scala:3410)
        at scala.reflect.internal.Symbols$StubSymbol.info(Symbols.scala:3421)
        at scala.reflect.internal.Symbols$StubSymbol.info$(Symbols.scala:3421)
        at scala.reflect.internal.Symbols$StubTermSymbol.info(Symbols.scala:3427)
        at scala.reflect.internal.Symbols$StubTermSymbol.info(Symbols.scala:3427)
        at scala.reflect.internal.pickling.UnPickler$Scan.nestedObjectSymbol$1(UnPickler.scala:228)
        at scala.reflect.internal.pickling.UnPickler$Scan.$anonfun$readSymbol$5(UnPickler.scala:259)
        at scala.reflect.internal.Symbols$Symbol.orElse(Symbols.scala:2493)
        at scala.reflect.internal.pickling.UnPickler$Scan.$anonfun$readSymbol$4(UnPickler.scala:259)
        at scala.reflect.internal.Symbols$Symbol.orElse(Symbols.scala:2493)
        at scala.reflect.internal.pickling.UnPickler$Scan.readExtSymbol$1(UnPickler.scala:257)
        at scala.reflect.internal.pickling.UnPickler$Scan.readSymbol(UnPickler.scala:279)
        at scala.reflect.internal.pickling.UnPickler$Scan.readSymbolRef(UnPickler.scala:645)
        at scala.reflect.internal.pickling.UnPickler$Scan.readThisType$1(UnPickler.scala:394)
        at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:409)
        at scala.reflect.internal.pickling.UnPickler$Scan.$anonfun$readTypeRef$1(UnPickler.scala:654)
        at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:177)
        at scala.reflect.internal.pickling.UnPickler$Scan.readTypeRef(UnPickler.scala:654)
        at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:413)
        at scala.reflect.internal.pickling.UnPickler$Scan.$anonfun$readTypeRef$1(UnPickler.scala:654)
        at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:177)
        at scala.reflect.internal.pickling.UnPickler$Scan.readTypeRef(UnPickler.scala:654)
        at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:417)
        at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.$anonfun$completeInternal$1(UnPickler.scala:721)
        at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:177)
        at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.completeInternal(UnPickler.scala:721)
        at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.complete(UnPickler.scala:745)
        at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.load(UnPickler.scala:748)
        at scala.reflect.internal.Symbols$Symbol.$anonfun$typeParams$1(Symbols.scala:1717)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
        at scala.reflect.internal.SymbolTable.enteringPhase(SymbolTable.scala:235)
        at scala.reflect.internal.Symbols$Symbol.typeParams(Symbols.scala:1717)
        at scala.tools.nsc.transform.SpecializeTypes.$anonfun$normalizeMember$1(SpecializeTypes.scala:848)
        at scala.runtime.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:12)
        at scala.reflect.internal.SymbolTable.enteringPhase(SymbolTable.scala:235)
        at scala.tools.nsc.Global.enteringTyper(Global.scala:977)
        at scala.tools.nsc.transform.SpecializeTypes.scala$tools$nsc$transform$SpecializeTypes$$normalizeMember(SpecializeTypes.scala:848)
        at scala.tools.nsc.transform.SpecializeTypes.$anonfun$specializeClass$30(SpecializeTypes.scala:801)
        at scala.collection.immutable.List.flatMap(List.scala:324)
        at scala.tools.nsc.transform.SpecializeTypes.specializeClass(SpecializeTypes.scala:799)
        at scala.tools.nsc.transform.SpecializeTypes.transformInfo(SpecializeTypes.scala:1214)
        at scala.tools.nsc.transform.InfoTransform$Phase$$anon$1.transform(InfoTransform.scala:38)
        at scala.reflect.internal.Symbols$Symbol.rawInfo(Symbols.scala:1588)
        at scala.reflect.internal.Symbols$Symbol.hasCompleteInfo(Symbols.scala:1552)
        at scala.tools.nsc.backend.jvm.BCodeHelpers.completeSilentlyAndCheckErroneous(BCodeHelpers.scala:229)
        at scala.tools.nsc.backend.jvm.BTypesFromSymbols.$anonfun$classBTypeFromSymbol$5(BTypesFromSymbols.scala:122)
        at scala.collection.MapLike.getOrElse(MapLike.scala:128)
        at scala.collection.MapLike.getOrElse$(MapLike.scala:126)
        at scala.collection.concurrent.TrieMap.getOrElse(TrieMap.scala:631)
        at scala.tools.nsc.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:118)
        at scala.tools.nsc.backend.jvm.BTypesFromSymbols.buildNestedInfo(BTypesFromSymbols.scala:486)
        at scala.tools.nsc.backend.jvm.BTypesFromSymbols.setClassInfo(BTypesFromSymbols.scala:442)
        at scala.tools.nsc.backend.jvm.BTypesFromSymbols.$anonfun$classBTypeFromSymbol$5(BTypesFromSymbols.scala:126)
        at scala.collection.MapLike.getOrElse(MapLike.scala:128)
        at scala.collection.MapLike.getOrElse$(MapLike.scala:126)
        at scala.collection.concurrent.TrieMap.getOrElse(TrieMap.scala:631)
        at scala.tools.nsc.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:118)
        at scala.tools.nsc.backend.jvm.BTypesFromSymbols.setClassInfo(BTypesFromSymbols.scala:345)
        at scala.tools.nsc.backend.jvm.BTypesFromSymbols.$anonfun$classBTypeFromSymbol$5(BTypesFromSymbols.scala:126)
        at scala.collection.MapLike.getOrElse(MapLike.scala:128)
        at scala.collection.MapLike.getOrElse$(MapLike.scala:126)
        at scala.collection.concurrent.TrieMap.getOrElse(TrieMap.scala:631)
        at scala.tools.nsc.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:118)
        at scala.tools.nsc.backend.jvm.BTypesFromSymbols.$anonfun$setClassInfo$17(BTypesFromSymbols.scala:440)
        at scala.collection.immutable.List.map(List.scala:272)
        at scala.tools.nsc.backend.jvm.BTypesFromSymbols.setClassInfo(BTypesFromSymbols.scala:440)
        at scala.tools.nsc.backend.jvm.BTypesFromSymbols.$anonfun$classBTypeFromSymbol$5(BTypesFromSymbols.scala:126)
        at scala.collection.MapLike.getOrElse(MapLike.scala:128)
        at scala.collection.MapLike.getOrElse$(MapLike.scala:126)
        at scala.collection.concurrent.TrieMap.getOrElse(TrieMap.scala:631)
        at scala.tools.nsc.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:118)
        at scala.tools.nsc.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.genPlainClass(BCodeSkelBuilder.scala:94)
        at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase$Worker1.visit(GenBCode.scala:190)
        at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase$Worker1.$anonfun$run$1(GenBCode.scala:139)
        at scala.tools.nsc.Global$GlobalPhase.withCurrentUnitNoLog(Global.scala:398)
        at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase$Worker1.run(GenBCode.scala:139)
        at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.buildAndSendToDisk(GenBCode.scala:381)
        at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.run(GenBCode.scala:350)
        at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1407)
        at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1392)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:1387)
        at scala.tools.nsc.Global$Run.compile(Global.scala:1481)
        at scala.tools.nsc.Driver.doCompile(Driver.scala:35)
        at scala.tools.nsc.MainClass.doCompile(Main.scala:24)
        at scala.tools.nsc.Driver.process(Driver.scala:55)
        at scala.tools.nsc.Driver.main(Driver.scala:68)
        at scala.tools.nsc.Main.main(Main.scala)
warning: !!! creating stub symbol to defer error: missing or invalid dependency detected while loading class file 'A1.class'.
Could not access term p3 in value p1.p2,
because it (or its dependencies) are missing. Check your build definition for
missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
A full rebuild may help if 'A1.class' was compiled against an incompatible version of p1.p2.
warning: !!! creating stub symbol to defer error: missing or invalid dependency detected while loading class file 'A1.class'.
Could not access term p3 in value p1.p2,
because it (or its dependencies) are missing. Check your build definition for
missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
A full rebuild may help if 'A1.class' was compiled against an incompatible version of p1.p2.
warning: !!! creating stub symbol to defer error: missing or invalid dependency detected while loading class file 'A1.class'.
Could not access type DeleteMe in value p1.p3,
because it (or its dependencies) are missing. Check your build definition for
missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
A full rebuild may help if 'A1.class' was compiled against an incompatible version of p1.p3.
four warnings found
one error found

@lrytz Do we need to compute NestedInfo for classes on the classpath?

@lrytz
Copy link
Member

lrytz commented Nov 24, 2016

In general yes, when a class (being compiled) has a reference to a nested class (from the classpath), we need it for emitting the corresponding InnerClass entry. But they could / should be computed lazily.

BTW, I think your example is incomplete, where are A1 / A1_Inner defined?

@retronym
Copy link
Member Author

@lrytz I've added the missing parts to the example.

retronym added a commit to retronym/scala that referenced this issue Nov 29, 2016
  - Limit the strategy of unpickling an external reference to a
    module class to a lookup of the module var to non-stub owners
    in order to enable fall through to stub symbol creation.

Fixes scala/scala-dev#275
retronym added a commit to retronym/scala that referenced this issue Nov 29, 2016
  - Limit the strategy of unpickling an external reference to a
    module class to a lookup of the module var to non-stub owners
    in order to enable fall through to stub symbol creation.

Fixes scala/scala-dev#275
@retronym retronym added this to the 2.12.1 milestone Nov 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants