From 110705eeace4f9165dc6377e55c86a599f37a465 Mon Sep 17 00:00:00 2001 From: Jared Barocsi Date: Tue, 5 Oct 2021 12:33:23 -0700 Subject: 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 --- .../chisel3/internal/sourceinfo/SourceInfoTransform.scala | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'macros/src/main') diff --git a/macros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala b/macros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala index a8a7e8d5..ac3e236c 100644 --- a/macros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala +++ b/macros/src/main/scala/chisel3/internal/sourceinfo/SourceInfoTransform.scala @@ -165,7 +165,12 @@ object SourceInfoTransform class SourceInfoTransform(val c: Context) extends AutoSourceTransform { import c.universe._ - def noArg(): c.Tree = { + def noArg: c.Tree = { + q"$thisObj.$doFuncTerm($implicitSourceInfo, $implicitCompileOptions)" + } + + /** Necessary for dummy methods to auto-apply their arguments to this macro */ + def noArgDummy(dummy: c.Tree*): c.Tree = { q"$thisObj.$doFuncTerm($implicitSourceInfo, $implicitCompileOptions)" } @@ -224,7 +229,12 @@ object SourceInfoWhiteboxTransform class SourceInfoWhiteboxTransform(val c: whitebox.Context) extends AutoSourceTransform { import c.universe._ - def noArg(): c.Tree = { + def noArg: c.Tree = { + q"$thisObj.$doFuncTerm($implicitSourceInfo, $implicitCompileOptions)" + } + + /** Necessary for dummy methods to auto-apply their arguments to this macro */ + def noArgDummy(dummy: c.Tree*): c.Tree = { q"$thisObj.$doFuncTerm($implicitSourceInfo, $implicitCompileOptions)" } -- cgit v1.2.3