Skip to content

Commit ce8a90b

Browse files
committed
Handle poly functions in functionArgsInfo
1 parent ecb434d commit ce8a90b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/core/TypeApplications.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -506,10 +506,11 @@ class TypeApplications(val self: Type) extends AnyVal {
506506
case _ => Nil
507507

508508
/** If this is an encoding of a function type, return its arguments, otherwise return Nil.
509-
* Handles ErasedFunctions gracefully.
509+
* Handles `ErasedFunction`s and poly functions gracefully.
510510
*/
511511
final def functionArgInfos(using Context): List[Type] = self.dealias match
512512
case RefinedType(parent, nme.apply, mt: MethodType) if defn.isErasedFunctionType(parent) => (mt.paramInfos :+ mt.resultType)
513+
case RefinedType(parent, nme.apply, mt: MethodType) if parent.typeSymbol eq defn.PolyFunctionClass => (mt.paramInfos :+ mt.resultType)
513514
case _ => self.dropDependentRefinement.dealias.argInfos
514515

515516
/** Argument types where existential types in arguments are disallowed */

0 commit comments

Comments
 (0)