Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions core/src/main/scala-2/chisel3/SelectableCompat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@

package chisel3

/** Does nothing in Scala 2; this stub trait is for maintaining
* compatibility with Scala 3's selectable, required to support
* structurally-typed Bundles in Scala 3.
/** Shim for Scala 3's `scala.reflect.Selectable`
*
* Allows Chisel to cross-compile Scala 2 and Scala 3
* while enabling structural typing in Scala 3.
*/
trait ReflectSelectable

/** Shim for Scala 3's `scala.Selectable`
*
* Allows Chisel to cross-compile Scala 2 and Scala 3
* while enabling structural typing in Scala 3.
*/
trait Selectable
5 changes: 5 additions & 0 deletions core/src/main/scala-3/chisel3/SelectableCompat.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// SPDX-License-Identifier: Apache-2.0

package chisel3

type ReflectSelectable = scala.reflect.Selectable
2 changes: 1 addition & 1 deletion core/src/main/scala/chisel3/Module.scala
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ package experimental {
/** Abstract base class for Modules, an instantiable organizational unit for RTL.
*/
// TODO: seal this?
abstract class BaseModule extends HasId with IsInstantiable {
abstract class BaseModule extends HasId with IsInstantiable with ReflectSelectable {
_parent.foreach(_.addId(this))

// Set if the returned top-level module of a nested call to the Chisel Builder, see Definition.apply
Expand Down