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

OutOfMemory / hang of scalac (typer bug?) #9151

Closed
scabug opened this issue Feb 15, 2015 · 3 comments
Closed

OutOfMemory / hang of scalac (typer bug?) #9151

scabug opened this issue Feb 15, 2015 · 3 comments

Comments

@scabug
Copy link

scabug commented Feb 15, 2015

The following repo case crashes scalac 2.11 and 2.10 with an OOM exception, or hangs pretty much forever if scalac is given loads of memory.

I haven't managed to reduce it further, but I'm under the impression it has to do with the widening of type constraints in the nested maps (where empty strings are returned).

// scalac bug.scala
class ImGonnaTakeForeverToCompile {
  abstract class Foo extends Ordered[Foo]

  val seq: Seq[Int] = null
  val set: Set[Int] = null
  val map: Map[Int, Int] = null
  val values: Map[Int, Set[Foo]] = null

  map ++ set.map(_ -> "")

  values ++ seq.groupBy(_ / 2).toSeq.map({
    case (key, group) =>
      key -> (values(key) ++ group.map(_ => ""))
  })
}

(I fixed my original non-reduced code by avoiding a widening that was introduced by mistake)

A quick jconsole sampling shows some / lots of time is spent in scala.reflect.internal.tpe.TypeConstraints.solve.

@scabug
Copy link
Author

scabug commented Feb 15, 2015

Imported From: https://issues.scala-lang.org/browse/SI-9151?orig=1
Reporter: Olivier Chafik (ochafik)
Affected Versions: 2.10.4, 2.11.4
Attachments:

@SethTisue
Copy link
Member

no change in 2.12.4 or 2.13.0-M3

sample stack trace of what the compiler is doing:

	at scala.reflect.internal.util.WeakHashSet.poll$1(WeakHashSet.scala:97)
	at scala.reflect.internal.util.WeakHashSet.queueLoop$1(WeakHashSet.scala:101)
	at scala.reflect.internal.util.WeakHashSet.removeStaleEntries(WeakHashSet.scala:115)
	at scala.reflect.internal.util.WeakHashSet.findEntryOrUpdate(WeakHashSet.scala:171)
	at scala.reflect.internal.Types.unique(Types.scala:3821)
	at scala.reflect.internal.Types.unique$(Types.scala:3810)
	at scala.reflect.internal.SymbolTable.unique(SymbolTable.scala:16)
	at scala.reflect.internal.Types$TypeRef$.apply(Types.scala:2450)
	at scala.reflect.internal.Types.copyTypeRef(Types.scala:3627)
	at scala.reflect.internal.Types.copyTypeRef$(Types.scala:3619)
	at scala.reflect.internal.SymbolTable.copyTypeRef(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:115)
	at scala.reflect.internal.tpe.TypeMaps$SubstSymMap.apply(TypeMaps.scala:819)
	at scala.reflect.internal.tpe.TypeMaps$SubstSymMap.apply(TypeMaps.scala:798)
	at scala.reflect.internal.Symbols$Symbol.modifyInfo(Symbols.scala:1558)
	at scala.reflect.internal.Symbols.$anonfun$cloneSymbolsAndModify$1(Symbols.scala:3660)
	at scala.reflect.internal.Symbols.cloneSymbolsAndModify(Symbols.scala:3660)
	at scala.reflect.internal.Symbols.cloneSymbolsAndModify$(Symbols.scala:3659)
	at scala.reflect.internal.SymbolTable.cloneSymbolsAndModify(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:242)
	at scala.reflect.internal.tpe.TypeMaps$TypeMap.$anonfun$mapOver$1(TypeMaps.scala:125)
	at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:199)
	at scala.reflect.internal.tpe.TypeMaps$SubstMap.apply(TypeMaps.scala:764)
	at scala.reflect.internal.tpe.TypeMaps$SubstSymMap.apply(TypeMaps.scala:825)
	at scala.reflect.internal.Types$Type.substSym(Types.scala:745)
	at scala.reflect.internal.Types.matchesQuantified$1(Types.scala:4309)
	at scala.reflect.internal.Types.matchesType(Types.scala:4359)
	at scala.reflect.internal.Types.matchesType$(Types.scala:4306)
	at scala.reflect.internal.SymbolTable.matchesType(SymbolTable.scala:16)
	at scala.reflect.internal.Types$Type.matches(Types.scala:879)
	at scala.reflect.internal.tpe.FindMembers$FindMemberBase.isNewMember(FindMembers.scala:158)
	at scala.reflect.internal.tpe.FindMembers$FindMembers.addMemberIfNew(FindMembers.scala:210)
	at scala.reflect.internal.tpe.FindMembers$FindMemberBase.walkBaseClasses(FindMembers.scala:98)
	at scala.reflect.internal.tpe.FindMembers$FindMemberBase.searchConcreteThenDeferred(FindMembers.scala:58)
	at scala.reflect.internal.tpe.FindMembers$FindMemberBase.apply(FindMembers.scala:48)
	at scala.reflect.internal.Types$Type.findMembersInternal$1(Types.scala:1018)
	at scala.reflect.internal.Types$Type.findMembers(Types.scala:1019)
	at scala.reflect.internal.Types$Type.membersBasedOnFlags(Types.scala:658)
	at scala.reflect.internal.Types$Type.nonPrivateMembers(Types.scala:604)
	at scala.reflect.internal.tpe.GlbLubs.lub1$1(GlbLubs.scala:362)
	at scala.reflect.internal.tpe.GlbLubs.lub0$1(GlbLubs.scala:304)
	at scala.reflect.internal.tpe.GlbLubs.lub(GlbLubs.scala:401)
	at scala.reflect.internal.tpe.GlbLubs.lub$(GlbLubs.scala:282)
	at scala.reflect.internal.SymbolTable.lub(SymbolTable.scala:16)
	at scala.reflect.internal.Types.$anonfun$mergePrefixAndArgs$7(Types.scala:4566)
	at scala.reflect.internal.Types.mergePrefixAndArgs(Types.scala:4554)
	at scala.reflect.internal.Types.mergePrefixAndArgs$(Types.scala:4520)
	at scala.reflect.internal.SymbolTable.mergePrefixAndArgs(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.GlbLubs.loop$1(GlbLubs.scala:137)
	at scala.reflect.internal.tpe.GlbLubs.lubList(GlbLubs.scala:168)
	at scala.reflect.internal.tpe.GlbLubs.lubList$(GlbLubs.scala:100)
	at scala.reflect.internal.SymbolTable.lubList(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.GlbLubs.lub1$1(GlbLubs.scala:311)
	at scala.reflect.internal.tpe.GlbLubs.lub0$1(GlbLubs.scala:304)
	at scala.reflect.internal.tpe.GlbLubs.lub(GlbLubs.scala:401)
	at scala.reflect.internal.tpe.GlbLubs.lub$(GlbLubs.scala:282)
	at scala.reflect.internal.SymbolTable.lub(SymbolTable.scala:16)
	at scala.reflect.internal.Types.$anonfun$mergePrefixAndArgs$7(Types.scala:4566)
	at scala.reflect.internal.Types.mergePrefixAndArgs(Types.scala:4554)
	at scala.reflect.internal.Types.mergePrefixAndArgs$(Types.scala:4520)
	at scala.reflect.internal.SymbolTable.mergePrefixAndArgs(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.GlbLubs.loop$1(GlbLubs.scala:137)
	at scala.reflect.internal.tpe.GlbLubs.lubList(GlbLubs.scala:168)
	at scala.reflect.internal.tpe.GlbLubs.lubList$(GlbLubs.scala:100)
	at scala.reflect.internal.SymbolTable.lubList(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.GlbLubs.lub1$1(GlbLubs.scala:311)
	at scala.reflect.internal.tpe.GlbLubs.lub0$1(GlbLubs.scala:304)
	at scala.reflect.internal.tpe.GlbLubs.lub(GlbLubs.scala:401)
	at scala.reflect.internal.tpe.GlbLubs.lub$(GlbLubs.scala:282)
	at scala.reflect.internal.SymbolTable.lub(SymbolTable.scala:16)
	at scala.reflect.internal.Types.$anonfun$mergePrefixAndArgs$7(Types.scala:4566)
	at scala.reflect.internal.Types.mergePrefixAndArgs(Types.scala:4554)
	at scala.reflect.internal.Types.mergePrefixAndArgs$(Types.scala:4520)
	at scala.reflect.internal.SymbolTable.mergePrefixAndArgs(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.GlbLubs.loop$1(GlbLubs.scala:137)
	at scala.reflect.internal.tpe.GlbLubs.lubList(GlbLubs.scala:168)
	at scala.reflect.internal.tpe.GlbLubs.lubList$(GlbLubs.scala:100)
	at scala.reflect.internal.SymbolTable.lubList(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.GlbLubs.lub1$1(GlbLubs.scala:311)
	at scala.reflect.internal.tpe.GlbLubs.lub0$1(GlbLubs.scala:304)
	at scala.reflect.internal.tpe.GlbLubs.lub(GlbLubs.scala:401)
	at scala.reflect.internal.tpe.GlbLubs.lub$(GlbLubs.scala:282)
	at scala.reflect.internal.SymbolTable.lub(SymbolTable.scala:16)
	at scala.reflect.internal.Types.$anonfun$mergePrefixAndArgs$7(Types.scala:4566)
	at scala.reflect.internal.Types.mergePrefixAndArgs(Types.scala:4554)
	at scala.reflect.internal.Types.mergePrefixAndArgs$(Types.scala:4520)
	at scala.reflect.internal.SymbolTable.mergePrefixAndArgs(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.GlbLubs.loop$1(GlbLubs.scala:137)
	at scala.reflect.internal.tpe.GlbLubs.lubList(GlbLubs.scala:168)
	at scala.reflect.internal.tpe.GlbLubs.lubList$(GlbLubs.scala:100)
	at scala.reflect.internal.SymbolTable.lubList(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.GlbLubs.lub1$1(GlbLubs.scala:311)
	at scala.reflect.internal.tpe.GlbLubs.lub0$1(GlbLubs.scala:304)
	at scala.reflect.internal.tpe.GlbLubs.lub(GlbLubs.scala:401)
	at scala.reflect.internal.tpe.GlbLubs.lub$(GlbLubs.scala:282)
	at scala.reflect.internal.SymbolTable.lub(SymbolTable.scala:16)
	at scala.reflect.internal.Types.$anonfun$mergePrefixAndArgs$7(Types.scala:4566)
	at scala.reflect.internal.Types.mergePrefixAndArgs(Types.scala:4554)
	at scala.reflect.internal.Types.mergePrefixAndArgs$(Types.scala:4520)
	at scala.reflect.internal.SymbolTable.mergePrefixAndArgs(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.GlbLubs.loop$1(GlbLubs.scala:137)
	at scala.reflect.internal.tpe.GlbLubs.lubList(GlbLubs.scala:168)
	at scala.reflect.internal.tpe.GlbLubs.lubList$(GlbLubs.scala:100)
	at scala.reflect.internal.SymbolTable.lubList(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.GlbLubs.lub1$1(GlbLubs.scala:311)
	at scala.reflect.internal.tpe.GlbLubs.lub0$1(GlbLubs.scala:304)
	at scala.reflect.internal.tpe.GlbLubs.lub(GlbLubs.scala:401)
	at scala.reflect.internal.tpe.GlbLubs.lub$(GlbLubs.scala:282)
	at scala.reflect.internal.SymbolTable.lub(SymbolTable.scala:16)
	at scala.reflect.internal.tpe.TypeConstraints.solveOne$1(TypeConstraints.scala:249)
	at scala.reflect.internal.tpe.TypeConstraints.$anonfun$solve$9(TypeConstraints.scala:260)
	at scala.reflect.internal.tpe.TypeConstraints.solve(TypeConstraints.scala:260)
	at scala.reflect.internal.tpe.TypeConstraints.solve$(TypeConstraints.scala:192)
	at scala.reflect.internal.SymbolTable.solve(SymbolTable.scala:16)
	at scala.tools.nsc.typechecker.Infer.solvedTypes(Infer.scala:145)
	at scala.tools.nsc.typechecker.Infer.solvedTypes$(Infer.scala:137)
	at scala.tools.nsc.interpreter.ReplGlobal$$anon$1.solvedTypes(ReplGlobal.scala:26)
	at scala.tools.nsc.typechecker.Infer$Inferencer.methTypeArgs(Infer.scala:553)
	at scala.tools.nsc.typechecker.Infer$Inferencer.$anonfun$isApplicableToMethod$3(Infer.scala:730)
	at scala.tools.nsc.typechecker.Infer$Inferencer.tryInstantiating$1(Infer.scala:114)
	at scala.tools.nsc.typechecker.Infer$Inferencer.typesCompatible$1(Infer.scala:740)
	at scala.tools.nsc.typechecker.Infer$Inferencer.isApplicableToMethod(Infer.scala:751)
	at scala.tools.nsc.typechecker.Infer$Inferencer.scala$tools$nsc$typechecker$Infer$Inferencer$$isApplicable(Infer.scala:770)
	at scala.tools.nsc.typechecker.Infer$Inferencer.$anonfun$isApplicable$2(Infer.scala:772)
	at scala.tools.nsc.typechecker.Infer$Inferencer.$anonfun$isApplicable$2$adapted(Infer.scala:772)
	at scala.tools.nsc.typechecker.Infer$Inferencer$$Lambda$1010/1217639236.apply(Unknown Source)
	at scala.reflect.internal.Symbols.createFromClonedSymbols(Symbols.scala:3669)
	at scala.reflect.internal.Symbols.createFromClonedSymbols$(Symbols.scala:3667)
	at scala.reflect.internal.SymbolTable.createFromClonedSymbols(SymbolTable.scala:16)
	at scala.tools.nsc.typechecker.Infer$Inferencer.scala$tools$nsc$typechecker$Infer$Inferencer$$isApplicable(Infer.scala:772)
	at scala.tools.nsc.typechecker.Infer$Inferencer$InferMethodAlternativeTwice$1.$anonfun$isAltApplicable$1(Infer.scala:1392)
	at scala.tools.nsc.typechecker.Infer$Inferencer$InferMethodAlternativeTwice$1.isAltApplicable(Infer.scala:1392)
	at scala.tools.nsc.typechecker.Infer$Inferencer$InferMethodAlternativeTwice$1.$anonfun$bestForExpectedType$1(Infer.scala:1395)
	at scala.tools.nsc.typechecker.Infer$Inferencer$InferMethodAlternativeTwice$1.$anonfun$bestForExpectedType$1$adapted(Infer.scala:1395)
	at scala.tools.nsc.typechecker.Infer$Inferencer$InferMethodAlternativeTwice$1$$Lambda$937/859617558.apply(Unknown Source)
	at scala.collection.TraversableLike.$anonfun$filterImpl$1(TraversableLike.scala:248)
	at scala.collection.TraversableLike$$Lambda$9/189568618.apply(Unknown Source)
	at scala.collection.immutable.List.foreach(List.scala:389)
	at scala.collection.TraversableLike.filterImpl(TraversableLike.scala:247)
	at scala.collection.TraversableLike.filterImpl$(TraversableLike.scala:245)
	at scala.collection.AbstractTraversable.filterImpl(Traversable.scala:104)
	at scala.collection.TraversableLike.filter(TraversableLike.scala:259)
	at scala.collection.TraversableLike.filter$(TraversableLike.scala:259)
	at scala.collection.AbstractTraversable.filter(Traversable.scala:104)
	at scala.tools.nsc.typechecker.Infer$Inferencer$InferMethodAlternativeTwice$1.bestForExpectedType(Infer.scala:1395)
	at scala.tools.nsc.typechecker.Infer$Inferencer$InferMethodAlternativeTwice$1.tryOnce(Infer.scala:1408)
	at scala.tools.nsc.typechecker.Contexts$Context$TryTwice.$anonfun$apply$1(Contexts.scala:369)
	at scala.tools.nsc.typechecker.Contexts$Context$TryTwice.apply(Contexts.scala:433)
	at scala.tools.nsc.typechecker.Infer$Inferencer.inferMethodAlternative(Infer.scala:1412)
	at scala.tools.nsc.typechecker.Typers$Typer.handleOverloaded$1(Typers.scala:3417)
	at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3421)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typed1$25(Typers.scala:4643)
	at scala.tools.nsc.typechecker.Typers$Typer$$Lambda$806/1538511917.apply(Unknown Source)
	at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:698)
	at scala.tools.nsc.typechecker.Typers$Typer.tryTypedApply$1(Typers.scala:4643)
	at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4727)
	at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4757)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5530)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5547)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5584)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5616)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5557)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5562)
	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5647)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3086)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3231)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3231)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1987)
	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1811)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5496)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5546)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5584)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5616)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5557)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5562)
	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5647)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3086)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3231)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3231)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1987)
	at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1858)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5497)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5546)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5584)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5616)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5557)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5562)
	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5647)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3086)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3231)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3231)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1987)
	at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1858)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5497)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5546)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5584)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5616)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5557)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5562)
	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5647)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3086)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3231)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3231)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1987)
	at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1858)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5497)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5546)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5584)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5616)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5557)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5562)
	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5647)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3086)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3231)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3231)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5207)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5499)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5546)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5584)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5616)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5557)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5562)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5643)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:104)
	at scala.tools.nsc.Global$GlobalPhase.$anonfun$applyPhase$1(Global.scala:436)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:429)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1(Analyzer.scala:94)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1$adapted(Analyzer.scala:93)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$Lambda$338/112061925.apply(Unknown Source)
	at scala.collection.Iterator.foreach(Iterator.scala:929)
	at scala.collection.Iterator.foreach$(Iterator.scala:929)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1417)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1452)
	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1436)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1429)
	at scala.tools.nsc.interpreter.IMain.compileSourcesKeepingRun(IMain.scala:431)
	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compileAndSaveRun(IMain.scala:800)
	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compile(IMain.scala:758)
	at scala.tools.nsc.interpreter.IMain$Request.compile$lzycompute(IMain.scala:947)
	- locked <0x00000007b1874038> (a scala.tools.nsc.interpreter.IMain$Request)
	at scala.tools.nsc.interpreter.IMain$Request.compile(IMain.scala:942)
	at scala.tools.nsc.interpreter.IMain.compile(IMain.scala:600)
	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:589)
	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:561)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:869)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:887)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:887)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:887)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:887)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:887)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:887)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:887)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:887)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:887)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:887)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:887)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:887)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:887)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:887)
	at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:737)
	at scala.tools.nsc.interpreter.ILoop.processLine(ILoop.scala:455)
	at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:476)
	at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:1052)
	at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:82)
	at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:85)
	at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:96)
	at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:101)
	at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

@diesalbla
Copy link

diesalbla commented Sep 20, 2018

@ochafik @SethTisue I have news on this issue. I have copied the code example into a pos example, and I have run it with the partest, using the current version of 2.13.x, that is this commit. The code successfully compiles, although it takes 8.24 seconds to do so. I have opened a PR to add the code as a pos example.

For comparing performance, I was running on Ubuntu Linux, OpenJDK version "1.8.0_181", on a system with 4 Cores and 16 GiB of RAM.

Update: I have also run this test (through partest) on the current 2.12.x branch, which is this commit. It took over 2 minutes of time to compile, so it seems that 2.13.x has improved notably on this bug.

@lrytz lrytz closed this as completed Nov 7, 2018
@SethTisue SethTisue modified the milestones: Backlog, 2.13.0-RC1 Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants