aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 6dda937d2..a0293d50a 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -685,6 +685,13 @@ object Types {
case _ => Nil
}
+ /** The parameter types in the first parameter section of a PolyType or MethodType, Empty list for others */
+ final def firstParamTypes: List[Type] = this match {
+ case mt: MethodType => mt.paramTypes
+ case pt: PolyType => pt.resultType.firstParamTypes
+ case _ => Nil
+ }
+
/** Is this either not a method at all, or a parameterless method? */
final def isParameterless: Boolean = this match {
case mt: MethodType => false