summaryrefslogtreecommitdiff
path: root/plugin/src/main
diff options
context:
space:
mode:
authorAdam Izraelevitz2021-09-15 11:49:29 -0700
committerGitHub2021-09-15 18:49:29 +0000
commit1ae18008e18dfe20983a6ba3b2b950f66245e69b (patch)
treef17d96d733e54eee5c8dd1551430ac874e10160d /plugin/src/main
parentc66f0ed24366f8ce0e20a5a420589b8ae01aba77 (diff)
Fix higher-kinded types for autoclonetype (#2121)
Diffstat (limited to 'plugin/src/main')
-rw-r--r--plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala b/plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala
index 96851e95..5fe63991 100644
--- a/plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala
+++ b/plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala
@@ -108,8 +108,10 @@ private[plugin] class BundleComponent(val global: Global, arguments: ChiselPlugi
if (isData(vp.symbol)) cloneTypeFull(select) else select
})
- val ttpe = Ident(bundle.symbol)
- val neww = localTyper.typed(New(ttpe, conArgs))
+ val tparamList = bundle.tparams.map{ t => Ident(t.symbol) }
+ val ttpe = if(tparamList.nonEmpty) AppliedTypeTree(Ident(bundle.symbol), tparamList) else Ident(bundle.symbol)
+ val newUntyped = New(ttpe, conArgs)
+ val neww = localTyper.typed(newUntyped)
// Create the symbol for the method and have it be associated with the Bundle class
val cloneTypeSym = bundle.symbol.newMethod(TermName("_cloneTypeImpl"), bundle.symbol.pos.focus, Flag.OVERRIDE | Flag.PROTECTED)