diff options
| author | Adam Izraelevitz | 2021-09-15 11:49:29 -0700 |
|---|---|---|
| committer | GitHub | 2021-09-15 18:49:29 +0000 |
| commit | 1ae18008e18dfe20983a6ba3b2b950f66245e69b (patch) | |
| tree | f17d96d733e54eee5c8dd1551430ac874e10160d /plugin/src | |
| parent | c66f0ed24366f8ce0e20a5a420589b8ae01aba77 (diff) | |
Fix higher-kinded types for autoclonetype (#2121)
Diffstat (limited to 'plugin/src')
| -rw-r--r-- | plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala | 6 |
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) |
