Skip to content

Commit 294afa0

Browse files
committed
Fix CG mixin init with type parameter.
1 parent 28a3038 commit 294afa0

File tree

20 files changed

+4
-2105
lines changed

20 files changed

+4
-2105
lines changed

compiler/src/dotty/tools/dotc/transform/linker/CollectSummaries.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,11 @@ class CollectSummaries extends MiniPhase { thisTransform =>
371371
} else {
372372
sym.owner.mixins.distinct.map { mixin =>
373373
val decl = mixin.primaryConstructor
374-
375-
decl.info match {
376-
case tp: PolyType =>
377-
CallInfo(decl.termRef, tp.paramRefs, tp.resType.paramTypess.iterator.flatten.toList, someThisCallInfo) // TODO get precise type params
378-
case tp =>
379-
CallInfo(decl.termRef, Nil, tp.paramTypess.iterator.flatten.toList, someThisCallInfo)
374+
val (tparams, params) = decl.info match {
375+
case tp: PolyType => (mixin.info.typeParams.map(_.paramRef), tp.resType.paramTypess.flatten)
376+
case tp => (Nil, tp.paramTypess.flatten)
380377
}
378+
CallInfo(decl.termRef, tparams, params, someThisCallInfo)
381379
}
382380
}
383381
}

tests/link-dce-failing/link-val-init-3.check

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/link-dce-stdlib/stdlib-link-3xqmark/scala/package.scala

Lines changed: 0 additions & 134 deletions
This file was deleted.

tests/link-dce-stdlib/stdlib-link-array-mkString/scala/package.scala

Lines changed: 0 additions & 134 deletions
This file was deleted.

0 commit comments

Comments
 (0)