diff options
Diffstat (limited to 'core')
| -rw-r--r-- | core/src/main/scala/chisel3/internal/Builder.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/src/main/scala/chisel3/internal/Builder.scala b/core/src/main/scala/chisel3/internal/Builder.scala index b1016a2e..084bdc88 100644 --- a/core/src/main/scala/chisel3/internal/Builder.scala +++ b/core/src/main/scala/chisel3/internal/Builder.scala @@ -532,8 +532,12 @@ private[chisel3] object Builder extends LazyLogging { dynamicContext.currentReset = newReset } - // This should only be used for testing - def allowReflectiveAutoCloneType: Boolean = dynamicContext.allowReflectiveAutoCloneType + // This should only be used for testing, must be true outside of Builder context + def allowReflectiveAutoCloneType: Boolean = { + dynamicContextVar.value + .map(_.allowReflectiveAutoCloneType) + .getOrElse(true) + } def allowReflectiveAutoCloneType_=(value: Boolean): Unit = { dynamicContext.allowReflectiveAutoCloneType = value } |
