From ce15ad50a5c175db06c3bba5e3bf46b6c5466c47 Mon Sep 17 00:00:00 2001 From: Megan Wachs Date: Tue, 5 Oct 2021 10:27:18 -0700 Subject: Remove all Bundle cloneTypes and chiselRuntimeDeprecate its use (#2052) * Remove all manual cloneTypes and make it chisel runtime deprecated to add one * runtime deprecate cloneType with runtime reflection * [Backport this commit] Bundle: add check that override def cloneType still works (will be made an error later) * Plugin: make it an error to override cloneType and add a test for that * Docs: can't compile the cloneType anymore * BundleSpec: comment out failing test I cannot get to fail or ignore Co-authored-by: Jack Koenig --- plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugin/src/main') diff --git a/plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala b/plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala index 5fe63991..67d744fc 100644 --- a/plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala +++ b/plugin/src/main/scala/chisel3/internal/plugin/BundleComponent.scala @@ -69,11 +69,14 @@ private[plugin] class BundleComponent(val global: Global, arguments: ChiselPlugi case con: DefDef if con.symbol.isPrimaryConstructor => primaryConstructor = Some(con) case d: DefDef if isNullaryMethodNamed("_cloneTypeImpl", d) => - val msg = "Users cannot override _cloneTypeImpl. Let the compiler plugin generate it. If you must, override cloneType instead." + val msg = "Users cannot override _cloneTypeImpl. Let the compiler plugin generate it." global.globalError(d.pos, msg) case d: DefDef if isNullaryMethodNamed("_usingPlugin", d) => val msg = "Users cannot override _usingPlugin, it is for the compiler plugin's use only." global.globalError(d.pos, msg) + case d: DefDef if isNullaryMethodNamed("cloneType", d) => + val msg = "Users cannot override cloneType. Let the compiler plugin generate it." + global.globalError(d.pos, msg) case _ => } (primaryConstructor, paramAccessors.toList) -- cgit v1.2.3