aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer/Applications.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-03-18 11:26:59 +0100
committerMartin Odersky <odersky@gmail.com>2017-04-06 13:15:28 +0200
commitdb4f7a19c9329d59da09a4de6b8476b4b6988cdf (patch)
treee70a1cf2d4af3a9e3e4b3999d5000b4466627143 /compiler/src/dotty/tools/dotc/typer/Applications.scala
parent26497bb3c654e294a48db2098978bc77b11f2889 (diff)
downloaddotty-db4f7a19c9329d59da09a4de6b8476b4b6988cdf.tar.gz
dotty-db4f7a19c9329d59da09a4de6b8476b4b6988cdf.tar.bz2
dotty-db4f7a19c9329d59da09a4de6b8476b4b6988cdf.zip
Further refactorings
- Use TypeLambda instead of PolyType. - Further harmonize factory operations
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer/Applications.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Applications.scala9
1 files changed, 2 insertions, 7 deletions
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] = {