Skip to content

Commit

Permalink
draft attempt to fix highlighting issue in IntelliJ for Bits.unary_~
Browse files Browse the repository at this point in the history
  • Loading branch information
unkarjedy committed Jan 10, 2025
1 parent e12935e commit c9edfd0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/src/main/scala-2/chisel3/Bits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ private[chisel3] sealed trait ToBoolable extends Element {
*/
sealed abstract class Bits(private[chisel3] val width: Width) extends BitsImpl with ToBoolable {

type Self <: Bits

/** Tail operator
*
* @param n the number of bits to remove
Expand Down Expand Up @@ -170,7 +172,7 @@ sealed abstract class Bits(private[chisel3] val width: Width) extends BitsImpl w
* @return this $coll with each bit inverted
* @group Bitwise
*/
final def unary_~ : Bits = macro SourceInfoWhiteboxTransform.noArg
final def unary_~ : Self = macro SourceInfoWhiteboxTransform.noArg

/** @group SourceInfoTransformMacro */
def do_unary_~(implicit sourceInfo: SourceInfo): Bits = _impl_unary_~
Expand Down Expand Up @@ -293,6 +295,7 @@ object Bits extends UIntFactory
* @define constantWidth @note The width of the returned $coll is unchanged, i.e., `width of this`.
*/
sealed class UInt private[chisel3] (width: Width) extends Bits(width) with UIntImpl {
type Self = UInt

// TODO: refactor to share documentation with Num or add independent scaladoc
/** Unary negation (expanding width)
Expand Down Expand Up @@ -566,6 +569,7 @@ object UInt extends UIntFactory
* @define constantWidth @note The width of the returned $coll is unchanged, i.e., `width of this`.
*/
sealed class SInt private[chisel3] (width: Width) extends Bits(width) with SIntImpl {
override type Self = SInt

/** Unary negation (constant width)
*
Expand Down Expand Up @@ -807,6 +811,8 @@ sealed class AsyncReset(private[chisel3] val width: Width = Width(1)) extends As
* @define numType $coll
*/
sealed class Bool() extends UInt(1.W) with BoolImpl with Reset {
//Compiler fails with error
//override type Self = Bool

// REVIEW TODO: Why does this need to exist and have different conventions
// than Bits?
Expand Down

0 comments on commit c9edfd0

Please sign in to comment.