Skip to content

Commit b111fdf

Browse files
committed
filterConserve: Reduce the chances of stack overflow
Observed when running the pos tests after the previous commit, the test suite didn't say which test caused the stackoverflow, but the stack trace ended with: at dotty.tools.dotc.core.Decorators$ListDecorator$.loop$2(Decorators.scala:90) at dotty.tools.dotc.core.Decorators$ListDecorator$.loop$2(Decorators.scala:90) at dotty.tools.dotc.core.Decorators$ListDecorator$.filterConserve$extension(Decorators.scala:97) at dotty.tools.dotc.core.OrderingConstraint.$anonfun$remove$1(OrderingConstraint.scala:453) at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:237) at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36) at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:198) at scala.collection.TraversableLike.map(TraversableLike.scala:237) at scala.collection.TraversableLike.map$(TraversableLike.scala:230) at scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:198) at dotty.tools.dotc.core.OrderingConstraint.removeFromBoundss$1(OrderingConstraint.scala:453) at dotty.tools.dotc.core.OrderingConstraint.$anonfun$remove$4(OrderingConstraint.scala:456) at dotty.tools.dotc.util.SimpleIdentityMap$MapMore.mapValuesNow(SimpleIdentityMap.scala:209) at dotty.tools.dotc.core.OrderingConstraint.removeFromOrdering$1(OrderingConstraint.scala:456) at dotty.tools.dotc.core.OrderingConstraint.remove(OrderingConstraint.scala:458) at dotty.tools.dotc.core.OrderingConstraint.replace(OrderingConstraint.scala:440) at dotty.tools.dotc.core.OrderingConstraint.replace(OrderingConstraint.scala:132) at dotty.tools.dotc.core.Types$TypeVar.instantiateWith(Types.scala:3712) at dotty.tools.dotc.core.Types$TypeVar.instantiate(Types.scala:3724) at dotty.tools.dotc.typer.Inferencing.$anonfun$interpolateTypeVars$2(Inferencing.scala:450) ...
1 parent 2f13c2a commit b111fdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/Decorators.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ object Decorators {
4444
}
4545
}
4646

47-
final val MaxFilterRecursions = 1000
47+
final val MaxFilterRecursions = 100
4848

4949
/** Implements filterConserve, zipWithConserve methods
5050
* on lists that avoid duplication of list nodes where feasible.

0 commit comments

Comments
 (0)