-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nowarn for first typecheck of macro invocation #8077
Comments
Imported From: https://issues.scala-lang.org/browse/SI-8077?orig=1 |
@xeno-by said: |
@som-snytt said: |
Teo Klestrup Röijezon (teozkr) said: |
@xeno-by said: import scala.reflect.macros.whitebox._
import scala.language.experimental.macros
object Macros {
def impl(c: Context)(x: c.Tree) = {
import c.universe._
q"()"
}
def foo(x: Any): Any = macro impl
}
object Test extends App {
Macros.foo {
1
2
}
} |
@som-snytt said: { val x = 1 ; 2 == x } |
scala/scala#8995 improves the situation w/r/t to "a pure expression does nothing in statement position" warnings in particular |
It would be useful if macro invocations could get a free pass on warnings before expansion.
That way, a build can run with warnings turned high and fatal, even if a macro does something like turn "a pure expression [that] does nothing in statement position" into a productive member of society, for example, by wrapping a boolean in an assert.
Perhaps enable it with
-Ymacro-no-warn
, and perhaps try to buffer the warnings and emit them if there are warnings after expansion. (The old warnings may or may not be meaningful for a given macro.)The text was updated successfully, but these errors were encountered: