Skip to content

Compilation (look like to) never end #9239

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
flomebul opened this issue Jun 24, 2020 · 3 comments · Fixed by #11239
Closed

Compilation (look like to) never end #9239

flomebul opened this issue Jun 24, 2020 · 3 comments · Fixed by #11239

Comments

@flomebul
Copy link
Contributor

Minimized code

This code (look like) to never end.
It finish normally if we use the last line (i.e. "case ? :: ? => ...") inside the previous one (i.e. "case ? => ...")

object ABug:
  sealed trait Bit
  sealed trait B0 extends Bit
  sealed trait B1 extends Bit

  sealed trait Bin
  sealed trait Nil extends Bin
  sealed trait ::[U <: Bit, D <: Bin] extends Bin

  type Zero = B0 :: Nil
  type One  = B1 :: Nil

  type --[B <: Bin] =
    B match
      case B1 :: d => B0 :: d
      case B0 :: B1 :: Nil => B1 :: Nil
      case B0 :: d => B1 :: --[d]

  type ×[N <: Bin, M <: Bin] =
    (N, M) match
      case (Zero, ?) => Zero

  type ![N <: Bin] =
    N match
      case Zero => One
      case One => One
      case ? => ![--[N]] × (N)
//      case ? :: ? => ![--[N]] × (N)

Output

No output at all !!!

Expectation

Terminate in a reasonable time, eventually with an error.

@odersky
Copy link
Contributor

odersky commented Jun 25, 2020

I think this is another case where a counter limiting match type reductions would help.

@flomebul
Copy link
Contributor Author

With delivery of 3.0.0-M3, I discover that the issue seems to be corrected, but not closed.
Could you check?

OlivierBlanvillain added a commit to dotty-staging/dotty that referenced this issue Jan 28, 2021
@OlivierBlanvillain
Copy link
Contributor

Yes, this seems to be fixed, thanks for the ping!

@nicolasstucki nicolasstucki linked a pull request Jan 29, 2021 that will close this issue
nicolasstucki added a commit that referenced this issue Jan 29, 2021
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.

3 participants