aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/typer')
-rw-r--r--src/dotty/tools/dotc/typer/Applications.scala8
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala6
2 files changed, 8 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala
index 4b43aa8b7..4d7bc8976 100644
--- a/src/dotty/tools/dotc/typer/Applications.scala
+++ b/src/dotty/tools/dotc/typer/Applications.scala
@@ -24,6 +24,7 @@ import EtaExpansion._
import collection.mutable
import reflect.ClassTag
import config.Printers._
+import TypeApplications._
import language.implicitConversions
object Applications {
@@ -266,7 +267,7 @@ trait Applications extends Compatibility { self: Typer =>
case arg :: Nil if isVarArg(arg) =>
addTyped(arg, formal)
case _ =>
- val elemFormal = formal.typeArgs.head
+ val elemFormal = formal.argTypesLo.head
args foreach (addTyped(_, elemFormal))
makeVarArg(args.length, elemFormal)
}
@@ -609,7 +610,7 @@ trait Applications extends Compatibility { self: Typer =>
if (extractorMemberType(unapplyResult, nme.isDefined) isRef defn.BooleanClass) {
if (getTp.exists)
if (unapply.symbol.name == nme.unapplySeq) {
- val seqArg = getTp.firstBaseTypeArg(defn.SeqClass)
+ val seqArg = boundsToHi(getTp.firstBaseArgInfo(defn.SeqClass))
if (seqArg.exists) return args map Function.const(seqArg)
}
else return getSelectors(getTp)
@@ -683,6 +684,7 @@ trait Applications extends Compatibility { self: Typer =>
}
var argTypes = unapplyArgs(unapplyApp.tpe)
+ for (argType <- argTypes) assert(!argType.isInstanceOf[TypeBounds], unapplyApp.tpe.show)
val bunchedArgs = argTypes match {
case argType :: Nil if argType.isRepeatedParam => untpd.SeqLiteral(args) :: Nil
case _ => args
@@ -770,7 +772,7 @@ trait Applications extends Compatibility { self: Typer =>
val tparams = ctx.newTypeParams(alt1.symbol.owner, tp1.paramNames, EmptyFlags, bounds)
isAsSpecific(alt1, tp1.instantiate(tparams map (_.typeRef)), alt2, tp2)
case tp1: MethodType =>
- def repeatedToSingle(tp: Type) = if (tp.isRepeatedParam) tp.typeArgs.head else tp
+ def repeatedToSingle(tp: Type) = if (tp.isRepeatedParam) tp.argTypesHi.head else tp
isApplicable(alt2, tp1.paramTypes map repeatedToSingle, WildcardType) ||
tp1.paramTypes.isEmpty && tp2.isInstanceOf[MethodOrPoly]
case _ =>
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 400a1407a..96fe73e7d 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -438,7 +438,7 @@ class Typer extends Namer with Applications with Implicits {
}
def typedPair(tree: untpd.Pair, pt: Type)(implicit ctx: Context) = track("typedPair") {
- val (leftProto, rightProto) = pt.typeArgs match {
+ val (leftProto, rightProto) = pt.argTypesLo match {
case l :: r :: Nil if pt isRef defn.PairClass => (l, r)
case _ => (WildcardType, WildcardType)
}
@@ -561,7 +561,7 @@ class Typer extends Namer with Applications with Implicits {
val params = args.asInstanceOf[List[untpd.ValDef]]
val (protoFormals, protoResult): (List[Type], Type) = pt match {
case _ if defn.isFunctionType(pt) =>
- (pt.dealias.typeArgs.init, pt.dealias.typeArgs.last)
+ (pt.dealias.argInfos.init, pt.dealias.argInfos.last)
case SAMType(meth) =>
val mt @ MethodType(_, paramTypes) = meth.info
(paramTypes, mt.resultType)
@@ -750,7 +750,7 @@ class Typer extends Namer with Applications with Implicits {
val expr1 = typed(tree.expr, pt)
val handler1 = typed(tree.handler, defn.FunctionType(defn.ThrowableType :: Nil, pt))
val finalizer1 = typed(tree.finalizer, defn.UnitType)
- val handlerTypeArgs = handler1.tpe.baseTypeArgs(defn.FunctionClass(1))
+ val handlerTypeArgs = handler1.tpe.baseArgTypesHi(defn.FunctionClass(1))
val ownType = if (handlerTypeArgs.nonEmpty) expr1.tpe | handlerTypeArgs(1) else expr1.tpe
cpy.Try(tree, expr1, handler1, finalizer1) withType ownType
}