From 43e4d6dbd0f131c7484dc24cb09ab3a25614cb62 Mon Sep 17 00:00:00 2001 From: Richard Lin Date: Fri, 22 Dec 2017 01:21:41 -0800 Subject: address review style comments --- chiselFrontend/src/main/scala/chisel3/core/Data.scala | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'chiselFrontend/src/main/scala/chisel3/core/Data.scala') diff --git a/chiselFrontend/src/main/scala/chisel3/core/Data.scala b/chiselFrontend/src/main/scala/chisel3/core/Data.scala index d84a86e9..35401fa1 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Data.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Data.scala @@ -209,11 +209,9 @@ abstract class Data extends HasId { } // If this Data is an instance of an inner class, record enclosing class - // This is only used for cloneType! - private[core] var outerModule: Option[BaseModule] = - (Option(this.getClass.getEnclosingClass) zip Builder.currentModule) - .find({ case (c, m) => c.isAssignableFrom(m.getClass) }) - .map({ case (_, m) => m }) + // This is only used for cloneType, and is mutable to allow autoCloneType to preserve the + // original outerModule. + private[core] var outerModule: Option[BaseModule] = Builder.currentModule // User-specified direction, local at this node only. // Note that the actual direction of this node can differ from child and parent specifiedDirection. -- cgit v1.2.3