Skip to content

Commit ce6ab76

Browse files
authored
Merge pull request #107 from scala/backport-lts-3.3-21741
Backport "Allow autotupling if fn's param is a type param" to 3.3 LTS
2 parents 36a8051 + 8542662 commit ce6ab76

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

tests/pos/i21682.1.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
sealed abstract class Gen[+T1]
2+
given [T2]: Conversion[T2, Gen[T2]] = ???
3+
4+
trait Show[T3]
5+
given Show[Boolean] = ???
6+
given [A1: Show, B1: Show, C1: Show]: Show[(A1, B1, C1)] = ???
7+
8+
object ForAll:
9+
def apply[A2: Show, B2](f: A2 => B2): Unit = ???
10+
def apply[A3: Show, B3: Show, C3](f: (A3, B3) => C3): Unit = ???
11+
def apply[A4: Show, B4](gen: Gen[A4])(f: A4 => B4): Unit = ???
12+
13+
@main def Test =
14+
ForAll: (b1: Boolean, b2: Boolean, b3: Boolean) =>
15+
???

tests/pos/i21682.2.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
object ForAll:
2+
def apply[A1, B](f: A1 => B): Unit = ???
3+
def apply[A1, A2, B](f: (A1, A2) => B): Unit = ???
4+
5+
@main def Test =
6+
ForAll: (b1: Boolean, b2: Boolean, b3: Boolean) =>
7+
???

tests/pos/i21682.3.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class Test:
2+
def foo[A1 >: (Nothing, Boolean, Nothing) <: (Any, Boolean, Any), B](f: A1 => B): Unit = ???
3+
def test(): Unit =
4+
val res4 = this.foo((b1: Boolean, b2: Boolean, b3: Boolean) => ???)

0 commit comments

Comments
 (0)