From 552c37d169b5a3a39ab89813eea5597cb11702fa Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Tue, 4 Feb 2025 20:14:39 -0800 Subject: [PATCH] Regression tests --- tests/neg/i19413.scala | 14 ++++++++++++++ tests/pos/i20070.scala | 7 +++++++ tests/warn/i23033.scala | 2 ++ 3 files changed, 23 insertions(+) create mode 100644 tests/neg/i19413.scala create mode 100644 tests/pos/i20070.scala diff --git a/tests/neg/i19413.scala b/tests/neg/i19413.scala new file mode 100644 index 000000000000..92eb6ce611bd --- /dev/null +++ b/tests/neg/i19413.scala @@ -0,0 +1,14 @@ + +import hello.bla.* // error + +//transparent inline def hello: kla.type = kla // ok +def hello: kla.type = kla + +object kla: + def ra = ??? + object bla { val ra1 = 31 } + +//import kla.bla.ra1 + +@main def test = println: + ra1 diff --git a/tests/pos/i20070.scala b/tests/pos/i20070.scala new file mode 100644 index 000000000000..c3061239f6d7 --- /dev/null +++ b/tests/pos/i20070.scala @@ -0,0 +1,7 @@ + +trait F[A] +given F[Int] = new F {} +def f[A: F] = { (x: A) => x } + +@main def test = + println(f[Int](1)) diff --git a/tests/warn/i23033.scala b/tests/warn/i23033.scala index 6170664e05e2..24153c235f4b 100644 --- a/tests/warn/i23033.scala +++ b/tests/warn/i23033.scala @@ -11,3 +11,5 @@ object Useful: given [T](using @unused ec: ExecutionContext): AnyRef with {} object Syntax: given [T] => (@unused ec: ExecutionContext) => AnyRef + +class i23122(@unused param: AnyRef)