Skip to content

Refinement with concrete type and method throw RecursionOverflow: #17381

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
steinybot opened this issue May 1, 2023 · 0 comments · Fixed by #17386
Closed

Refinement with concrete type and method throw RecursionOverflow: #17381

steinybot opened this issue May 1, 2023 · 0 comments · Fixed by #17386

Comments

@steinybot
Copy link

steinybot commented May 1, 2023

Compiler version

3.3.0-RC3

Minimized code

type Y = { type T = String; def u(): T }

trait Test {

  val y1: Y
  val y2 = y1.u()
}

Output

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.
For the unprocessed stack trace, compile with -Yno-decode-stacktraces.
A recurring operation is (inner to outer):

  find-member Object#T
  find-member Object#T
  find-member Object#T
  find-member Object#T
  find-member Object#T
  find-member Object#T
  find-member Object#T
  find-member Object#T
  find-member Object#T
  find-member Object#T
  ...

  find-member Object#T
  find-member Object#T
  find-member Object#T
  find-member Object#T
  find-member Object#T
  find-member Object#T
  find-member Object#T
  find-member Object#T
  find-member Object#T
  find-member y1.u

Expectation

I'm would expect this one to compile.

It is pretty strange. It triggers when:

  • The refinement has a concrete type member.
  • There is a method that has a parameter list (even if empty) and the return type is the type member

This is similar to #17380 although it appears to be quite different but perhaps it is the same underlying bug. This one throws at the call site.

@steinybot steinybot added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels May 1, 2023
@Kordyjan Kordyjan added area:typer and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels May 1, 2023
@Kordyjan Kordyjan linked a pull request May 4, 2023 that will close this issue
@smarter smarter closed this as completed in f7ba81c May 5, 2023
@Kordyjan Kordyjan added this to the 3.3.1 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants