Skip to content

Commit e199fc8

Browse files
Fix inline-named-typeargs.scala by handling named type parameter patterns
1 parent b54537f commit e199fc8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,8 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
512512
val (meth, targs, argss) = decomposeCall(fn)
513513
(meth, targs, argss :+ args)
514514
case TypeApply(fn, targs) =>
515-
val (meth, Nil, Nil) = decomposeCall(fn)
516-
(meth, targs, Nil)
515+
val (meth, targss, args) = decomposeCall(fn)
516+
(meth, targs ++ targss, args)
517517
case _ =>
518518
(tree, Nil, Nil)
519519
}

tests/pos/inline-named-typeargs.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
object t1 {
2+
inline def construct[Elem, Coll[_]](xs: List[Elem]): Coll[Elem] = ???
3+
4+
val xs3 = construct[Coll = List](List(1, 2, 3))
5+
}

0 commit comments

Comments
 (0)