-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13253 from dotty-staging/fix-10867
Fix #10867: Normalize after applyIfParameterized in superType
- Loading branch information
Showing
3 changed files
with
57 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/pos-deep-subtype/9849.scala → ...ustom-args/allow-deep-subtypes/9849.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
type *:[A, B] = A match | ||
type *:[A, B] = A match // error: Recursion limit exceeded. | ||
case (B *: x) => A | ||
case (x *: y) => x *: (B *: y) | ||
case _ => A *: B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
object Test { | ||
type inserts[a, as <: Tuple] <: Tuple = | ||
as match | ||
case EmptyTuple => (a *: EmptyTuple) *: EmptyTuple | ||
case y *: ys => (a *: y *: ys) *: Tuple.Map[inserts[a, ys], [t <: Tuple] =>> y *: t] | ||
|
||
type inserts2[a] = | ||
[as <: Tuple] =>> inserts[a, as] | ||
|
||
type A = inserts [1, EmptyTuple] | ||
type B = inserts2[1][EmptyTuple] | ||
|
||
summon[A =:= ((1 *: EmptyTuple) *: EmptyTuple)] | ||
summon[B =:= ((1 *: EmptyTuple) *: EmptyTuple)] | ||
summon[A =:= B] | ||
|
||
type H[t <: Tuple] = Tuple.Concat[t, EmptyTuple] | ||
|
||
summon[H[A] =:= H[B]] | ||
|
||
summon[Tuple.Concat[A, EmptyTuple] =:= Tuple.Concat[B, EmptyTuple]] | ||
} | ||
|
||
object Minimized { | ||
type Concombre[X <: Tuple, +Y <: Tuple] <: Tuple = X match { | ||
case EmptyTuple => Y | ||
case x1 *: xs1 => X | ||
} | ||
|
||
type inserts[a, as <: Tuple] <: Tuple = | ||
as match | ||
case EmptyTuple => a *: EmptyTuple | ||
|
||
type inserts2[a] = | ||
[as <: Tuple] =>> inserts[a, as] | ||
|
||
type A = inserts [1, EmptyTuple] | ||
type B = inserts2[1][EmptyTuple] | ||
type C = 1 *: EmptyTuple | ||
|
||
summon[A =:= B] | ||
summon[A =:= C] | ||
summon[B =:= C] | ||
|
||
type H[t <: Tuple] = Concombre[t, EmptyTuple] | ||
|
||
summon[H[C] =:= H[A]] | ||
summon[H[C] =:= H[B]] | ||
} |