Skip to content

StackOverflow in TypeApplications #5860

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

Closed
nicolasstucki opened this issue Feb 6, 2019 · 4 comments
Closed

StackOverflow in TypeApplications #5860

nicolasstucki opened this issue Feb 6, 2019 · 4 comments
Labels

Comments

@nicolasstucki
Copy link
Contributor

i4371b.scala (#4371) has been spuriously failing with a stack overflow

object App {
  type T[G[X] <: X, F[X] <: G[F[X]]]
}
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Feb 6, 2019
@nicolasstucki
Copy link
Contributor Author

@abgruszecki
Copy link
Contributor

AFAIR this was related to runtime state of JVM and therefore difficult to reproduce - we just sometimes hit the stack limit. @nicolasstucki do we want to care about this, or do we want to close the issue?

@smarter
Copy link
Member

smarter commented Apr 4, 2019

You could try to reproduce by reducing the stack size used by the JVM (-Xss)

@liufengyun
Copy link
Contributor

Now the compiler reports:

-- Error: examples/i5860.scala:2:25 --------------------------------------------
2 |  type T[G[X] <: X, F[X] <: G[F[X]]]
  |                         ^
  |Recursion limit exceeded.
  |Maybe there is an illegal cyclic reference?
  |If that's not the case, you could also try to increase the stacksize using the -Xss JVM option.
  |A recurring operation is (inner to outer):
  |
  |  type parameters of G[LazyRef(F[X])]
  |  type parameters of F[X]
  |  type parameters of LazyRef(F[X])
  |  type parameters of G[LazyRef(F[X])]
  |  type parameters of F[X]
  |  type parameters of LazyRef(F[X])
  |  type parameters of G[LazyRef(F[X])]
  |  type parameters of F[X]
  |  type parameters of LazyRef(F[X])
  |  type parameters of G[LazyRef(F[X])]
  |  ...
  |
  |  type parameters of G[LazyRef(F[X])]
  |  type parameters of F[X]
  |  type parameters of LazyRef(F[X])
  |  type parameters of G[LazyRef(F[X])]
  |  type parameters of F[X]
  |  type parameters of LazyRef(F[X])
  |  type parameters of G[LazyRef(F[X])]
  |  type parameters of F[X]
  |  type parameters of G[F[X]]
  |  type parameters of  <: G[F[X]]
one error found

@odersky odersky closed this as completed Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants