-
Notifications
You must be signed in to change notification settings - Fork 1.1k
StackOverflow in typer #4368
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
Labels
Comments
Other ways to do the same thing trait W {
type A
type B
}
trait X { z: W =>
type A = z.B
type B
}
trait Y { z: W =>
type A
type B = z.A
}
trait Z extends X with Y trait W {
type A
type B
}
trait X { z: W =>
type A = z.B
type B
}
trait Y { z: W =>
type A
type B = z.A
}
object App {
type Z = X with Y
val z: Z = z
val a: z.A = a
} trait X[F[_]] {
protected type A = F[B]
protected type B
}
trait Y[F[_]] {
protected type A
protected type B = F[A]
}
trait Fix[F[_]] extends X[F] with Y[F] {
type Result = A
} trait X {
type A = B
type B
}
trait Y {
type A
type B = A
}
object App {
type Z = X & Y
val z: Z = z
val a: z.A = a
} trait W { type T <: W; val t: T }
trait X {
type A = b.T
val a : A = b.t
type B <: W
val b : B
}
trait Y {
type A <: W
val a : A
type B = a.T
val b = a.t
}
trait Z extends X with Y class Fix[F[_]] {
class Foo { type R >: F[T] <: F[T] }
type T = F[Foo#R]
}
object App {
type Nat = Fix[Option]#T
} |
trait W {
type A
}
trait X extends W {
type A = B
type B
}
trait Y extends W {
type A
type B = A
}
trait Foo[X <: W, Y <: W] {
type Z = X & Y
val z: Z
val a: z.A
}
trait Boo {
val f: Foo[X, Y]
}
trait Baz extends Boo {
val a = f.a // only this line triggers StackOverflow
// remove it and it compiles fine
} |
This was referenced Apr 25, 2018
Would be good to know what scalac does in this case. |
For the first example, StackOverflow in
|
scala/bug#10846 reports quite a few examples also stack overflow there. The last one fails due to volatility checks: trait W {
type A
}
trait X extends W {
type A = B
type B
}
trait Y extends W {
type A
type B = A
}
trait Foo[X <: W, Y <: W] {
type Z = X with Y
val z: Z
val a: z.A
} |
Looks like a duplicate of one of the oldest issue still open: #318 |
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 26, 2018
This now handles all errors from scala#4368 to scala#4372 and also scala#318.
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 26, 2018
This now handles all errors from scala#4368 to scala#4372 and also scala#318.
Blaisorblade
pushed a commit
to dotty-staging/dotty
that referenced
this issue
May 7, 2018
This now handles all errors from scala#4368 to scala#4372 and also scala#318.
Blaisorblade
added a commit
to dotty-staging/dotty
that referenced
this issue
May 8, 2018
Blaisorblade
pushed a commit
to dotty-staging/dotty
that referenced
this issue
May 30, 2018
This now handles all errors from scala#4368 to scala#4372 and also scala#318.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: