Skip to content
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

Type projection on parameterized refinement fails pickling test #7445

Open
Katrix opened this issue Oct 22, 2019 · 3 comments
Open

Type projection on parameterized refinement fails pickling test #7445

Katrix opened this issue Oct 22, 2019 · 3 comments
Labels
area:pickling backlog No work planned on this by the core team for the time being. itype:bug

Comments

@Katrix
Copy link
Contributor

Katrix commented Oct 22, 2019

minimized code

type O1[A] = {
  type OutInner[Ts] <: Tuple = Ts match {
    case Unit   => Unit
    case h *: t => h *: OutInner[t]
  }
  
  type Out = OutInner[A]
}

def f1: O1[(Int, Int)]#Out = ???

expectation

The code works fine. If no partial application is used it works fine.
https://scastie.scala-lang.org/IhFycVEdRVmJOjSAtXCw6Q

@OlivierBlanvillain
Copy link
Contributor

Further minimized without match types:

object Main {
  type O1[A] = {
    type OutInner[X] = Unit
    type Out = OutInner[A]
  }

  def f1: O1[Int]#Out = ???
}

error:

-- Error: /home/olivier/7445.scala:9:10 --------------------------------------
9 |  def f1: O1[Int]#Out = ???
  |          ^
  |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):
  |
  |  find-member Object#OutInner
  |  find-member Object#OutInner
  |  find-member Object#OutInner
  |  find-member Object#OutInner
  |  find-member Object#OutInner
  |  find-member Object#OutInner
  |  find-member Object#OutInner
  |  find-member Object#OutInner
  |  find-member Object#OutInner
  |  find-member Object#OutInner
  |  ...
  |
  |  find-member Object#OutInner
  |  find-member Object#OutInner
  |  find-member Object#OutInner
  |  find-member Object#OutInner
  |  find-member Object#OutInner
  |  find-member Object#OutInner
  |  find-member Object#OutInner
  |  find-member Object#OutInner
  |  find-member O1#OutInner
  |  find-member O1#Out
one error found

@OlivierBlanvillain OlivierBlanvillain changed the title Partially applied match types cause Recursion limit exceeded Type projection on parameterized refinement type causes Recursion limit exceeded Oct 24, 2019
@odersky odersky added the backlog No work planned on this by the core team for the time being. label Apr 5, 2022
@ckipp01
Copy link
Member

ckipp01 commented May 11, 2023

Trying this out, the minimized version now compiles.

//> using scala 3.3.1-RC1-bin-20230510-d6c643c-NIGHTLY

object Main {
  type O1[A] = {
    type OutInner[X] = Unit
    type Out = OutInner[A]
  }

  def f1: O1[Int]#Out = ???
}

I'm gong to go ahead and close, but feel free to report back if I'm misunderstanding and this issue still persists.

@ckipp01 ckipp01 closed this as completed May 11, 2023
ckipp01 added a commit to ckipp01/dotty that referenced this issue May 12, 2023
ckipp01 added a commit to ckipp01/dotty that referenced this issue May 12, 2023
This adds in a regression test for the minimized issue, but the original
one now has a different issue with pickling. I've added this in as well,
but added it to the excludes.
@ckipp01
Copy link
Member

ckipp01 commented May 12, 2023

I was a bit too eager with closing this. While the minimized version does now compile, the original one has a giant stacktrace that fails the pickling test. I've gone ahead and added tests for these in #17475, but I'll re-open this due to the pickling failure. The stacktrace is literally thousands of lines long, so I didn't include it.

@ckipp01 ckipp01 reopened this May 12, 2023
@ckipp01 ckipp01 changed the title Type projection on parameterized refinement type causes Recursion limit exceeded Type projection on parameterized refinement fails pickling test May 12, 2023
ckipp01 added a commit to ckipp01/dotty that referenced this issue May 14, 2023
This adds in a regression test for the minimized issue, but the original
one now has a different issue with pickling. I've added this in as well,
but added it to the excludes.
nicolasstucki added a commit that referenced this issue May 15, 2023
So this adds in a test that shows that the minimized version of the
original issue is fixed, but the original report now fails the pickling
tests. I've gone ahead and added a test for that as well, but added it
to the excludes. I'll reopen the issue and mention this update.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:pickling backlog No work planned on this by the core team for the time being. itype:bug
Projects
None yet
Development

No branches or pull requests

4 participants