diff options
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/Types.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 64fa48071..636204f64 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -217,6 +217,14 @@ object Types { case _ => false } + /** Is this the type of a method with a leading empty parameter list? + */ + def isNullaryMethod(implicit ctx: Context): Boolean = this match { + case MethodType(Nil, _) => true + case tp: PolyType => tp.resultType.isNullaryMethod + case _ => false + } + /** Is this an alias TypeBounds? */ def isAlias: Boolean = this.isInstanceOf[TypeAlias] |