From e4eb186dd1957a000a4fbc84ead59d8b8478f87a Mon Sep 17 00:00:00 2001 From: Anatolii Kmetiuk Date: Tue, 15 Jun 2021 16:15:17 +0200 Subject: [PATCH] Fix #12474: add regression test --- tests/pos/i12474.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/pos/i12474.scala diff --git a/tests/pos/i12474.scala b/tests/pos/i12474.scala new file mode 100644 index 000000000000..41762fba55c1 --- /dev/null +++ b/tests/pos/i12474.scala @@ -0,0 +1,17 @@ +package bugreport + +import scala.compiletime.erasedValue + +trait Show[A]: + def show(a: A): String + +inline def showTuple[Types]: Show[Types] = + inline erasedValue[Types] match + case _: (head *: tail) => + val instance = + new Show[head *: tail]: + def show(tuple: head *: tail): String = "dummy" + instance.asInstanceOf[Show[Types]] + +@main def run() = + showTuple[(Int, Int)]