From db4f7a19c9329d59da09a4de6b8476b4b6988cdf Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 18 Mar 2017 11:26:59 +0100 Subject: Further refactorings - Use TypeLambda instead of PolyType. - Further harmonize factory operations --- compiler/src/dotty/tools/dotc/typer/Applications.scala | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (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 cd7c7fd66..25c9c13d8 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -34,7 +34,7 @@ object Applications { def extractorMember(tp: Type, name: Name)(implicit ctx: Context) = { def isPossibleExtractorType(tp: Type) = tp match { - case _: MethodType | _: PolyType => false + case _: MethodOrPoly => false case _ => true } tp.member(name).suchThat(d => isPossibleExtractorType(d.info)) @@ -1412,12 +1412,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic => recur(altFormals.map(_.tail), args1) case _ => } - def paramTypes(alt: Type): List[Type] = alt match { - case mt: MethodType => mt.paramInfos - case mt: PolyType => paramTypes(mt.resultType) - case _ => Nil - } - recur(alts.map(alt => paramTypes(alt.widen)), pt.args) + recur(alts.map(_.widen.firstParamTypes), pt.args) } private def harmonizeWith[T <: AnyRef](ts: List[T])(tpe: T => Type, adapt: (T, Type) => T)(implicit ctx: Context): List[T] = { -- cgit v1.2.3