Skip to content

Commit

Permalink
Add more aliases tests for context bounds with poly functions
Browse files Browse the repository at this point in the history
  • Loading branch information
KacperFKorban committed Oct 8, 2024
1 parent 980213b commit c71c71c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/pos/contextbounds-for-poly-functions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c71c71c

Please sign in to comment.