aboutsummaryrefslogtreecommitdiff
path: root/src/dotty
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty')
-rw-r--r--src/dotty/tools/dotc/typer/Checking.scala10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/typer/Checking.scala b/src/dotty/tools/dotc/typer/Checking.scala
index 0baf48fa3..f18c5bf7c 100644
--- a/src/dotty/tools/dotc/typer/Checking.scala
+++ b/src/dotty/tools/dotc/typer/Checking.scala
@@ -54,13 +54,11 @@ object Checking {
def traverse(tree: Tree)(implicit ctx: Context) = {
tree match {
case AppliedTypeTree(tycon, args) =>
- // If `args` is a list of named argiments, return corresponding type parameters,
+ // If `args` is a list of named arguments, return corresponding type parameters,
// otherwise return type parameters unchanged
- def matchNamed(tparams: List[TypeSymbol], args: List[Tree]): List[TypeSymbol] = args match {
- case Nil => Nil
- case NamedArg(name, arg) :: args1 =>
- val (matchingParam :: Nil, others) = tparams.partition(_.name == name)
- matchingParam :: matchNamed(others, args1)
+ def matchNamed(tparams: List[TypeSymbol], args: List[Tree]): List[Symbol] = args match {
+ case (arg: NamedArg) :: _ =>
+ for (NamedArg(name, arg) <- args) yield tycon.tpe.member(name).symbol
case _ =>
tparams
}