From 99ad076b5f1e7c93cfd7257fdbe9c19394d01e09 Mon Sep 17 00:00:00 2001 From: Matt Bovel Date: Fri, 14 Feb 2025 12:48:28 +0000 Subject: [PATCH 1/2] Add regression test for #22076 --- tests/pos/match-type-disjoint-22076.scala | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/pos/match-type-disjoint-22076.scala diff --git a/tests/pos/match-type-disjoint-22076.scala b/tests/pos/match-type-disjoint-22076.scala new file mode 100644 index 000000000000..4b0161b1ef88 --- /dev/null +++ b/tests/pos/match-type-disjoint-22076.scala @@ -0,0 +1,8 @@ +trait Foo[ CP <: NonEmptyTuple ]: + type EndNode = Tuple.Last [CP] + +def f( end : Foo[?] ) : end.EndNode = + ??? + +trait Bar[CP <: NonEmptyTuple] extends Foo[CP]: + val v: EndNode = f(this) From fcb1a4cc4bb6f5493d8c73d718a658e9350d97d3 Mon Sep 17 00:00:00 2001 From: Matt Bovel Date: Fri, 14 Feb 2025 14:23:43 +0100 Subject: [PATCH 2/2] Update tests/pos/match-type-disjoint-22076.scala MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sébastien Doeraene --- tests/pos/match-type-disjoint-22076.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/pos/match-type-disjoint-22076.scala b/tests/pos/match-type-disjoint-22076.scala index 4b0161b1ef88..c10555501b97 100644 --- a/tests/pos/match-type-disjoint-22076.scala +++ b/tests/pos/match-type-disjoint-22076.scala @@ -1,7 +1,7 @@ -trait Foo[ CP <: NonEmptyTuple ]: - type EndNode = Tuple.Last [CP] +trait Foo[CP <: NonEmptyTuple]: + type EndNode = Tuple.Last[CP] -def f( end : Foo[?] ) : end.EndNode = +def f(end: Foo[?]): end.EndNode = ??? trait Bar[CP <: NonEmptyTuple] extends Foo[CP]: