From 0a93f942f8c78bef053dd298356b7c453eaf77f8 Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Mon, 18 Nov 2024 10:34:32 +0100 Subject: [PATCH 1/3] Handle old given syntax where identifier and type are seperated by new line (#21957) Fixes #21768 Fixes usages of `with {...}` and `= new {}` declarations presented in tests. --- tests/pos/i21768.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/pos/i21768.scala diff --git a/tests/pos/i21768.scala b/tests/pos/i21768.scala new file mode 100644 index 000000000000..85066d0cb8a6 --- /dev/null +++ b/tests/pos/i21768.scala @@ -0,0 +1,12 @@ + +trait Foo[T]: + def foo(v: T): Unit + +given myFooOfInt: + Foo[Int] with + def foo(v: Int): Unit = ??? + +given myFooOfLong: + Foo[Long] = new Foo[Long] { + def foo(v: Long): Unit = ??? + } From 9fd2bdef789b62ec8c0482e2817d9d6b29e6ac74 Mon Sep 17 00:00:00 2001 From: Tomasz Godzik Date: Thu, 6 Mar 2025 19:25:36 +0100 Subject: [PATCH 2/3] Handle old given syntax where identifier and type are seperated by new line (#21957) Fixes #21768 Fixes usages of `with {...}` and `= new {}` declarations presented in tests. [Cherry-picked 7644ecd6a4933a1750c527a16007f5890c45d0e7][modified] From 3fe62446f56a77bd6be7792d001ebd1a85674196 Mon Sep 17 00:00:00 2001 From: Tomasz Godzik Date: Thu, 6 Mar 2025 21:07:26 +0100 Subject: [PATCH 3/3] bugfix: Fix patmat tests --- tests/patmat/null.check | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/patmat/null.check b/tests/patmat/null.check index 36d64f44e2d2..1656af3c9943 100644 --- a/tests/patmat/null.check +++ b/tests/patmat/null.check @@ -1,4 +1,4 @@ 6: Pattern Match 13: Pattern Match -20: Pattern Match -21: Match case Unreachable +20: Match case Unreachable +21: Pattern Match