Skip to content

Commit 9cd4c0d

Browse files
committed
Work around "a pure expression does nothing" warning, take 3
Fixes sbt#6161 Ref scala/bug#12112 This uses the configurable warning backported to Scala 2.12.
1 parent ff6cbf2 commit 9cd4c0d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core-macros/src/main/scala/sbt/internal/util/appmacro/Instance.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ object Instance {
201201
val tx = util.transformWrappers(tree, (n, tpe, t, replace) => sub(n, tpe, t, replace))
202202
// resetting attributes must be: a) local b) done here and not wider or else there are obscure errors
203203
val tr = makeApp(inner(tx))
204-
c.Expr[i.M[N[T]]](tr)
204+
val noWarn = q"""($tr: @scala.annotation.nowarn("cat=other-pure-statement"))"""
205+
c.Expr[i.M[N[T]]](noWarn)
205206
}
206207

207208
import Types._

0 commit comments

Comments
 (0)