From 9d0aa36c879f4bde68e01e0ba9decab21d8fce49 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 10 Mar 2017 19:38:39 +0100 Subject: Construct MethodTypes from parameter closure To allow for dependencies between method type parameters, construct MethodTypes from a closure that maps the currently constructed MethodType to its parameter types. --- compiler/src/dotty/tools/dotc/typer/Applications.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler/src/dotty/tools/dotc/typer/Applications.scala') diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index a65ef00cc..b459e2745 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -1263,7 +1263,8 @@ trait Applications extends Compatibility { self: Typer with Dynamic => def sizeFits(alt: TermRef, tp: Type): Boolean = tp match { case tp: PolyType => sizeFits(alt, tp.resultType) - case MethodType(_, ptypes) => + case tp: MethodType => + val ptypes = tp.paramTypes val numParams = ptypes.length def isVarArgs = ptypes.nonEmpty && ptypes.last.isRepeatedParam def hasDefault = alt.symbol.hasDefaultParams -- cgit v1.2.3