Skip to content

Fix #9239: Add regression test #11239

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

Merged
merged 1 commit into from
Jan 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions tests/pos/9239.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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)