You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having defined a simple method with an implicit argument, e.g.
traitAdefx(implicita: A) = a
we can easily make the compiler to fail with stack overflow using (possibly errornous, but nevertheless) converting of an unapplied function to a function value:
valz= x _
Stack trace is
java.lang.StackOverflowError
at scala.reflect.internal.Types$Type.isError(Types.scala:298)
at scala.reflect.internal.Types$SimpleTypeProxy.isError(Types.scala:141)
at scala.reflect.internal.Types$SimpleTypeProxy.isError$(Types.scala:141)
at scala.reflect.internal.Types$SingletonType.isError(Types.scala:1088)
at scala.reflect.internal.tpe.TypeMaps$ErroneousCollector$.traverse(TypeMaps.scala:1093)
at scala.reflect.internal.tpe.TypeMaps$TypeTraverser.apply(TypeMaps.scala:300)
at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:123)
at scala.reflect.internal.tpe.TypeMaps$ErroneousCollector$.traverse(TypeMaps.scala:1094)
at scala.reflect.internal.tpe.TypeMaps$TypeTraverser.apply(TypeMaps.scala:300)
at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:123)
at scala.reflect.internal.tpe.TypeMaps$ErroneousCollector$.traverse(TypeMaps.scala:1094)
at scala.reflect.internal.tpe.TypeMaps$TypeTraverser.apply(TypeMaps.scala:300)
at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:110)
at scala.reflect.internal.tpe.TypeMaps$ErroneousCollector$.traverse(TypeMaps.scala:1094)
at scala.reflect.internal.tpe.TypeMaps$TypeCollector.collect(TypeMaps.scala:312)
at scala.reflect.internal.Types$Type.isErroneous(Types.scala:301)
at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$applyImplicitArgs$2(Typers.scala:172)
at scala.collection.immutable.List.foreach(List.scala:378)
at scala.tools.nsc.typechecker.Typers$Typer.applyImplicitArgs(Typers.scala:166)
at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$adapt$2(Typers.scala:850)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:703)
at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$adapt$1(Typers.scala:849)
at scala.tools.nsc.typechecker.Typers$Typer.withCondConstrTyper(Typers.scala:482)
at scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:847)
at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1197)
at scala.tools.nsc.typechecker.Typers$Typer.typedEta$1(Typers.scala:4523)
at scala.tools.nsc.typechecker.Typers$Typer.typedTyped$1(Typers.scala:5224)
at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5469)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5483)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5519)
at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5549)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5493)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5497)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5594)
at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$adapt$3(Typers.scala:867)
at scala.tools.nsc.typechecker.Typers$SilentResult.orElse(Typers.scala:77)
at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$adapt$1(Typers.scala:854)
at scala.tools.nsc.typechecker.Typers$Typer.withCondConstrTyper(Typers.scala:482)
etc...
The text was updated successfully, but these errors were encountered:
I have checked out the version 2.12.4, and tested the following code, added to a neg test file.
objectt10156 {
traitAdefx(implicita: A) = a
valz= x _
}
Running this with partest test/files/pos/t10156.scala no longer gives a StackOverflow, but with a compiler error. It would seem that this bug has been solved since at least version 2.12.4.
Having defined a simple method with an implicit argument, e.g.
we can easily make the compiler to fail with stack overflow using (possibly errornous, but nevertheless) converting of an unapplied function to a function value:
Stack trace is
etc...
The text was updated successfully, but these errors were encountered: