Skip to content

Commit c71c71c

Browse files
committed
Add more aliases tests for context bounds with poly functions
1 parent 980213b commit c71c71c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/pos/contextbounds-for-poly-functions.scala

+6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ type ComparerRef = [X] => (x: X, y: X) => Ord[X] ?=> Boolean
2424
type Comparer = [X: Ord] => (x: X, y: X) => Boolean
2525
val less3: Comparer = [X: Ord as ord] => (x: X, y: X) => ord.compare(x, y) < 0
2626

27+
type CmpRest[X] = X => Boolean
28+
type CmpMid[X] = X => CmpRest[X]
29+
type Cmp3 = [X: Ord] => X => CmpMid[X]
30+
val lessCmp3: Cmp3 = [X: Ord] => (x: X) => (y: X) => (z: X) => summon[Ord[X]].compare(x, y) < 0
31+
val lessCmp3_1: Cmp3 = [X: Ord as ord] => (x: X) => (y: X) => (z: X) => ord.compare(x, y) < 0
32+
2733
// type Cmp[X] = (x: X, y: X) => Boolean
2834
// type Comparer2 = [X: Ord] => Cmp[X]
2935
// val less4: Comparer2 = [X: Ord] => (x: X, y: X) => summon[Ord[X]].compare(x, y) < 0

0 commit comments

Comments
 (0)