This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
You can continue the conversation there. Go to discussion →
Ykind-projector
usecase that prevent cross-compilation with Scala 2 : higher-kind-parameterised type-lambdas
#17672
The documentation of kind-projector provides valuable information as to what is and what isn't possible to cross-compile. This is greatly appreciated, however, here's a usecase that doesn't seem to have a non-projection-based way of cross-compilng with Scala 2.
Compiler version
3.2.1
Minimized example
The problem can be described as a formulation a type lambda that depends on a method bound and that expresses partial application where of a parametric type, where the free type variable is higher-kinded.
We're trying to express when its
F
paramerter is fixed,PolyFunction
forms aFunctorK
Scala 3 :
Scala 2 (using the kind-projector compiler plugin)
The only way I'm aware of cross-compiling this is to resort to the de-sugared Scala 2 encoding :
Desugared encoding, which compiles on both Scala 2 and Scala 3
Expectation
I'd personally appreciate if the support for
λ
in Scala 3 was not limited to*
-kinded type parameters, and if we could write the following, which compiles in Scala 2 using kind-projector.The text was updated successfully, but these errors were encountered: