We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 390071e commit 6db3ba4Copy full SHA for 6db3ba4
compiler/src/dotty/tools/dotc/core/TypeErasure.scala
@@ -209,10 +209,13 @@ object TypeErasure {
209
einfo
210
case einfo =>
211
// Erase the parameters of `apply` in subclasses of PolyFunction
212
+ // Preserve PolyFunction argument types to support PolyFunctions with
213
+ // PolyFunction arguments
214
if (sym.is(TermParam) && sym.owner.name == nme.apply
- && sym.owner.owner.derivesFrom(defn.PolyFunctionClass))
215
+ && sym.owner.owner.derivesFrom(defn.PolyFunctionClass)
216
+ && !(tp <:< defn.PolyFunctionType)) {
217
defn.ObjectType
- else
218
+ } else
219
220
}
221
0 commit comments