From c71c71c535dca211b1f735bbfc08cfdbe568f0dc Mon Sep 17 00:00:00 2001 From: Kacper Korban Date: Tue, 8 Oct 2024 10:51:53 +0200 Subject: [PATCH] Add more aliases tests for context bounds with poly functions --- tests/pos/contextbounds-for-poly-functions.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/pos/contextbounds-for-poly-functions.scala b/tests/pos/contextbounds-for-poly-functions.scala index 8c7bead36633..a3b79043c01a 100644 --- a/tests/pos/contextbounds-for-poly-functions.scala +++ b/tests/pos/contextbounds-for-poly-functions.scala @@ -24,6 +24,12 @@ type ComparerRef = [X] => (x: X, y: X) => Ord[X] ?=> Boolean type Comparer = [X: Ord] => (x: X, y: X) => Boolean val less3: Comparer = [X: Ord as ord] => (x: X, y: X) => ord.compare(x, y) < 0 +type CmpRest[X] = X => Boolean +type CmpMid[X] = X => CmpRest[X] +type Cmp3 = [X: Ord] => X => CmpMid[X] +val lessCmp3: Cmp3 = [X: Ord] => (x: X) => (y: X) => (z: X) => summon[Ord[X]].compare(x, y) < 0 +val lessCmp3_1: Cmp3 = [X: Ord as ord] => (x: X) => (y: X) => (z: X) => ord.compare(x, y) < 0 + // type Cmp[X] = (x: X, y: X) => Boolean // type Comparer2 = [X: Ord] => Cmp[X] // val less4: Comparer2 = [X: Ord] => (x: X, y: X) => summon[Ord[X]].compare(x, y) < 0