diff options
| author | Jared Barocsi | 2021-10-05 12:33:23 -0700 |
|---|---|---|
| committer | GitHub | 2021-10-05 19:33:23 +0000 |
| commit | 110705eeace4f9165dc6377e55c86a599f37a465 (patch) | |
| tree | 4e6ed88311fd1ce08cebc0225868d2d103c6fae7 /core/src/main/scala/chisel3/Clock.scala | |
| parent | ce15ad50a5c175db06c3bba5e3bf46b6c5466c47 (diff) | |
Deprecate auto-application of empty argument lists to parameterless functions (#2124)
* Migrate nullary funcs to parameterless versions
* Make deprecation message and dummy arguments clear and consistent
Co-authored-by: Megan Wachs <megan@sifive.com>
Diffstat (limited to 'core/src/main/scala/chisel3/Clock.scala')
| -rw-r--r-- | core/src/main/scala/chisel3/Clock.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/src/main/scala/chisel3/Clock.scala b/core/src/main/scala/chisel3/Clock.scala index edb07908..0400697d 100644 --- a/core/src/main/scala/chisel3/Clock.scala +++ b/core/src/main/scala/chisel3/Clock.scala @@ -32,8 +32,12 @@ sealed class Clock(private[chisel3] val width: Width = Width(1)) extends Element def toPrintable: Printable = PString("CLOCK") /** Returns the contents of the clock wire as a [[Bool]]. */ - final def asBool(): Bool = macro SourceInfoTransform.noArg - def do_asBool(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool = this.asUInt().asBool() + final def asBool: Bool = macro SourceInfoTransform.noArg + + @deprecated("Calling this function with an empty argument list is invalid in Scala 3. Use the form without parentheses instead", "Chisel 3.5") + final def asBool(dummy: Int*): Bool = macro SourceInfoTransform.noArgDummy + + def do_asBool(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool = this.asUInt.asBool override def do_asUInt(implicit sourceInfo: SourceInfo, connectCompileOptions: CompileOptions): UInt = pushOp(DefPrim(sourceInfo, UInt(this.width), AsUIntOp, ref)) private[chisel3] override def connectFromBits(that: Bits)(implicit sourceInfo: SourceInfo, |
