forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix scala#11318: properly detect enclosing extension methods from a p…
…olyfunction.
- Loading branch information
1 parent
07d8ff8
commit fab6d3c
Showing
3 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
extension(a: Int) | ||
def b: Int = ??? | ||
def h: Unit = | ||
[A] => (r: Int) => b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
type FunctionK[A[_], B[_]] = [Z] => A[Z] => B[Z] | ||
type ~>:[A[_], B[_]] = FunctionK[A, B] | ||
|
||
trait RepresentableK[F[_[_], _]]: | ||
type RepresentationK[_] | ||
|
||
def tabulateK[A[_], C](f: RepresentationK ~>: A): F[A, C] | ||
|
||
extension[A[_], C](fa: F[A, C]) | ||
def indexK: RepresentationK ~>: A | ||
|
||
def mapK[B[_]] (f: A ~>: B): F[B, C] = | ||
tabulateK([Z] => (r: RepresentationK[Z]) => f(indexK(r))) |