diff --git a/tests/pos/i16208.scala b/tests/pos/i16208.scala new file mode 100644 index 000000000000..18455f2e698c --- /dev/null +++ b/tests/pos/i16208.scala @@ -0,0 +1,12 @@ + +class Ann(x: Any) extends annotation.Annotation +object Message: + implicit def toNoExplanation(str: String): Message @Ann(str) = ??? +class Message + +object report: + def error(x: Message): Unit = ??? + +def test = + report.error("a") // works + report.error("a".stripMargin) // was an error diff --git a/tests/pos/i19749.scala b/tests/pos/i19749.scala new file mode 100644 index 000000000000..367c5f61bdce --- /dev/null +++ b/tests/pos/i19749.scala @@ -0,0 +1,15 @@ +import scala.deriving.Mirror + +case class A(x: Int, y: String) + +trait SomeTrait[T] + +object SomeTrait: + given [T]: SomeTrait[T] with {} + +def f1[T](using p: Mirror.ProductOf[T]): Tuple.Elem[p.MirroredElemTypes, 0] = ??? + +def f2[T, R](f: T => R)(using SomeTrait[R]) = ??? + +// Scala3.3 is fine, 3.4 has compilation errors, p MirroredElemTypes type is missing and has been changed to Nothing +val x = f2(_ => f1[A])