Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions compiler/src/dotty/tools/dotc/transform/init/Objects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,7 @@ object Objects:
val applyDenot = getMemberMethod(scrutineeType, nme.apply, applyType(elemType))
val applyRes = call(scrutinee, applyDenot.symbol, TraceValue(Bottom, summon[Trace]) :: Nil, scrutineeType, superType = NoType, needResolve = true)

if isWildcardStarArg(pats.last) then
if isWildcardStarArgList(pats) then
if pats.size == 1 then
// call .toSeq
val toSeqDenot = scrutineeType.member(nme.toSeq).suchThat(_.info.isParameterless)
Expand All @@ -1433,7 +1433,8 @@ object Objects:
end if
else
// no patterns like `xs*`
for pat <- pats do evalPattern(applyRes, pat)
for pat <- pats do evalPattern(applyRes, pat)
end if
end evalSeqPatterns


Expand Down
6 changes: 6 additions & 0 deletions tests/init-global/pos/i18629.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
object Foo {
val bar = List() match {
case List() => ???
case _ => ???
}
}