We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9a73eb commit 13da5f5Copy full SHA for 13da5f5
plugin/src/main/scala-3/chisel3/internal/plugin/BundlePhase.scala
@@ -38,7 +38,14 @@ object BundleHelpers {
38
thiz: tpd.This,
39
conArgs: List[List[tpd.Tree]]
40
)(using Context): tpd.DefDef = {
41
- val newExpr = tpd.New(record.symbol.typeRef, conArgs.flatten)
+ val newExpr: tpd.Tree = conArgs match {
42
+ case Nil => tpd.New(record.symbol.typeRef, Nil)
43
+ case head :: tail =>
44
+ val headApp = tpd.New(record.symbol.typeRef, head)
45
+ tail.foldLeft(headApp: tpd.Tree) { (fun, args) =>
46
+ tpd.Apply(fun, args)
47
+ }
48
49
val recordTpe = requiredClassRef("chisel3.Record")
50
val cloneTypeSym = newSymbol(
51
record.symbol,
0 commit comments