scala/bug

Stack overflow during compilation due infinity recursion in the `scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.outerPath` method

plokhotnyuk opened this issue · 2 comments

Here is a top of the stacktrace for scalac version is 2.12.6:

java.lang.StackOverflowError
	at java.lang.String.valueOf(String.java:2994)
	at scala.collection.mutable.StringBuilder.append(StringBuilder.scala:200)
	at scala.collection.TraversableOnce.$anonfun$addString$1(TraversableOnce.scala:359)
	at scala.collection.immutable.List.foreach(List.scala:389)
	at scala.collection.TraversableOnce.addString(TraversableOnce.scala:357)
	at scala.collection.TraversableOnce.addString$(TraversableOnce.scala:353)
	at scala.collection.AbstractTraversable.addString(Traversable.scala:104)
	at scala.collection.TraversableOnce.mkString(TraversableOnce.scala:323)
	at scala.collection.TraversableOnce.mkString$(TraversableOnce.scala:322)
	at scala.collection.AbstractTraversable.mkString(Traversable.scala:104)
	at scala.collection.TraversableOnce.mkString(TraversableOnce.scala:325)
	at scala.collection.TraversableOnce.mkString$(TraversableOnce.scala:325)
	at scala.collection.AbstractTraversable.mkString(Traversable.scala:104)
	at scala.collection.TraversableOnce.mkString(TraversableOnce.scala:327)
	at scala.collection.TraversableOnce.mkString$(TraversableOnce.scala:327)
	at scala.collection.AbstractTraversable.mkString(Traversable.scala:104)
	at xsbt.DelegatingReporter$.makePosition$1(DelegatingReporter.scala:89)
	at xsbt.DelegatingReporter$.convert(DelegatingReporter.scala:94)
	at xsbt.DelegatingReporter.info0(DelegatingReporter.scala:125)
	at xsbt.DelegatingReporter.info0(DelegatingReporter.scala:102)
	at scala.reflect.internal.Reporter.error(Reporting.scala:84)
	at scala.reflect.internal.Reporting.globalError(Reporting.scala:69)
	at scala.reflect.internal.Reporting.globalError$(Reporting.scala:69)
	at scala.reflect.internal.SymbolTable.globalError(SymbolTable.scala:18)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.outerSelect(ExplicitOuter.scala:235)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.outerPath(ExplicitOuter.scala:267)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.outerPath(ExplicitOuter.scala:267)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.outerPath(ExplicitOuter.scala:267)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.outerPath(ExplicitOuter.scala:267)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.outerPath(ExplicitOuter.scala:267)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.outerPath(ExplicitOuter.scala:267)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.outerPath(ExplicitOuter.scala:267)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.outerPath(ExplicitOuter.scala:267)
	at scala.tools.nsc.transform.ExplicitOuter$OuterPathTransformer.outerPath(ExplicitOuter.scala:267)

Hard to say without code, but most likely a duplicate of #10035 and has a PR.

@Jasper-M thank you!

It looks like the same case of accessing to outer symbols through the reflection API.