Skip to content

crash on compilable code: StackOverflowError #3703

@helloqirun

Description

@helloqirun

scalac compiles but dotc crashes.

$ dotc -version

Dotty compiler version 0.5.0-bin-SNAPSHOT-git-4fefb64 -- Copyright 2002-2017, LAMP/EPFL

$ dotc abc.scala

Exception in thread "main" java.lang.StackOverflowError
        at dotty.tools.dotc.core.Types$LazyRef.ref(Types.scala:2179)
        at dotty.tools.dotc.core.Types$TypeMap.mapOver$$anonfun$1(Types.scala:3885)
        at dotty.tools.dotc.core.Types$LazyRef.ref(Types.scala:2179)
        at dotty.tools.dotc.core.Types$TypeMap.mapOver$$anonfun$1(Types.scala:3885)
        at dotty.tools.dotc.core.Types$LazyRef.ref(Types.scala:2179)
        at dotty.tools.dotc.core.Types$TypeMap.mapOver$$anonfun$1(Types.scala:3885)
        at dotty.tools.dotc.core.Types$LazyRef.ref(Types.scala:2179)
        at dotty.tools.dotc.core.Types$TypeMap.mapOver$$anonfun$1(Types.scala:3885)
        at dotty.tools.dotc.core.Types$LazyRef.ref(Types.scala:2179)
        at dotty.tools.dotc.core.Types$TypeMap.mapOver$$anonfun$1(Types.scala:3885)
        at dotty.tools.dotc.core.Types$LazyRef.ref(Types.scala:2179)
        at dotty.tools.dotc.core.Types$TypeMap.mapOver$$anonfun$1(Types.scala:3885)
        at dotty.tools.dotc.core.Types$LazyRef.ref(Types.scala:2179)
        at dotty.tools.dotc.core.Types$TypeMap.mapOver$$anonfun$1(Types.scala:3885)
        at dotty.tools.dotc.core.Types$LazyRef.ref(Types.scala:2179)
        at dotty.tools.dotc.core.Types$TypeMap.mapOver$$anonfun$1(Types.scala:3885)
        at dotty.tools.dotc.core.Types$LazyRef.ref(Types.scala:2179)
        at dotty.tools.dotc.core.Types$TypeMap.mapOver$$anonfun$1(Types.scala:3885)
        at dotty.tools.dotc.core.Types$LazyRef.ref(Types.scala:2179)
<snipped>

$ cat abc.scala

package bar {
  trait M[F[_]]
  class S[X[_] <: M[X], A](val x: X[A])
  object S {
    def apply[X[_] <: M[X], A](x: X[A]): S[X, A] = S[X, A](x)
    def unapply[X[_] <: M[X], A](p: S[X, A]) = S(p x)
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions