From ca902680df772445371e6c3dd907c01113afb1f5 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Mon, 25 Apr 2022 10:53:46 -0700 Subject: [PATCH] Fix warning injected into user code by @chiselName (#2500) In Scala 2.13, Auto-application to `()` is deprecated. Any nullary method (ie. a method with no arguments) that is defined with () must now be called with (). @chiselName used to inject a case of this warning into user code which would then cause a warning on the @chiselName macro that the user has no way to fix. --- .../main/scala/chisel3/internal/naming/NamingAnnotations.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/src/main/scala/chisel3/internal/naming/NamingAnnotations.scala b/macros/src/main/scala/chisel3/internal/naming/NamingAnnotations.scala index 82223d782c0..b12826fc540 100644 --- a/macros/src/main/scala/chisel3/internal/naming/NamingAnnotations.scala +++ b/macros/src/main/scala/chisel3/internal/naming/NamingAnnotations.scala @@ -125,7 +125,7 @@ class NamingTransforms(val c: Context) { q""" val $contextVar = $globalNamingStack.pushContext() ..$transformedBody - if($globalNamingStack.length == 1){ + if($globalNamingStack.length() == 1){ $contextVar.namePrefix("") } $globalNamingStack.popReturnContext(this, $contextVar)