From 1ae18008e18dfe20983a6ba3b2b950f66245e69b Mon Sep 17 00:00:00 2001 From: Adam Izraelevitz Date: Wed, 15 Sep 2021 11:49:29 -0700 Subject: Fix higher-kinded types for autoclonetype (#2121) --- plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugin') 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) -- cgit v1.2.3