diff --git a/core/src/main/scala-3/chisel3/properties/ObjectIntf.scala b/core/src/main/scala-3/chisel3/properties/ObjectIntf.scala index 88653df03ed..703b373841b 100644 --- a/core/src/main/scala-3/chisel3/properties/ObjectIntf.scala +++ b/core/src/main/scala-3/chisel3/properties/ObjectIntf.scala @@ -2,6 +2,18 @@ package chisel3.properties +import chisel3.experimental.SourceInfo + private[chisel3] trait DynamicObjectObjIntf { self: DynamicObject.type => - // TODO implement + + /** A wrapper method to wrap Class instantiations and return a DynamicObject. + * + * This is necessary to help Chisel track internal state. This can be used instead of `Definition.apply` if a + * DynamicObject is required. If possible, it is safer to user `Definition.apply` and StaticObject. + * + * @param bc the Class being created + * + * @return a DynamicObject representing an instance of the Class + */ + def apply[T <: Class](bc: => T)(using SourceInfo): DynamicObject = _applyImpl(bc) } diff --git a/src/test/scala-2/chiselTests/properties/ObjectSpec.scala b/src/test/scala/chiselTests/properties/ObjectSpec.scala similarity index 100% rename from src/test/scala-2/chiselTests/properties/ObjectSpec.scala rename to src/test/scala/chiselTests/properties/ObjectSpec.scala diff --git a/src/test/scala-2/chiselTests/properties/PropertySpec.scala b/src/test/scala/chiselTests/properties/PropertySpec.scala similarity index 100% rename from src/test/scala-2/chiselTests/properties/PropertySpec.scala rename to src/test/scala/chiselTests/properties/PropertySpec.scala