Scala3: Is it possible to create a MethodType which has multiple argument lists?

The first argument of MethodTypeModule#apply takes paramNames: List[String], and it appears that MethodType does not support multiple argument lists.

Here is the definition of MethodTypeModule#apply:

def apply(paramNames: List[String])(paramInfosExp: MethodType => List[TypeRepr], resultTypeExp: MethodType => TypeRepr): MethodType

It seems that by nesting MethodType.apply, a curried MethodType can be generated.

MethodType.apply(???)(???, _ => MethodType.apply(???, (???, ???)))
1 Like

Yep this is the way - you can read more here