Skip to content

Commit 2afcf39

Browse files
Add regression tests
Closes #19749 Closes #16208
1 parent fb15fe3 commit 2afcf39

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

tests/pos/i16208.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
class Ann(x: Any) extends annotation.Annotation
3+
object Message:
4+
implicit def toNoExplanation(str: String): Message @Ann(str) = ???
5+
class Message
6+
7+
object report:
8+
def error(x: Message): Unit = ???
9+
10+
def test =
11+
report.error("a") // works
12+
report.error("a".stripMargin) // was an error

tests/pos/i19749.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import scala.deriving.Mirror
2+
3+
case class A(x: Int, y: String)
4+
5+
trait SomeTrait[T]
6+
7+
object SomeTrait:
8+
given [T]: SomeTrait[T] with {}
9+
10+
def f1[T](using p: Mirror.ProductOf[T]): Tuple.Elem[p.MirroredElemTypes, 0] = ???
11+
12+
def f2[T, R](f: T => R)(using SomeTrait[R]) = ???
13+
14+
// Scala3.3 is fine, 3.4 has compilation errors, p MirroredElemTypes type is missing and has been changed to Nothing
15+
val x = f2(_ => f1[A])

0 commit comments

Comments
 (0)