I’ve noticed that if I call c.info(pos, "message", force = false) inside a macro, it prints out on compilation despite the force parameter. The docs say that should mean the message is suppressed.
[INFO] <filepath> Message! is always logged, with force = true and force = false.
Note this only happens on sbt compile - it does not happen in a repl.
I’ve tried digging through the source scala code to find out why it’s doing this, but without an IDE it’s not very navigable.
Could anyone more knowledgeable point me in the right direction? I know it calls info in scala.tools.nsc.reporters.Reporter, which then calls some implementation of info0, but for the life of me I cannot find which one. I’ve tagged every implementation of info0 and none are called.
It seems you cannot rely on a specific behavior with respect to that parameter. The doc says that messages may be suppressed, without specifying when they are or aren’t.
Regarding the ‘may’ in the documentation, you’re right it is ambiguous.
So it is expected behaviour that all internal logging of all macros is exposed to the end user during compilation? That’s not great behaviour in my opinion. Perhaps I can make this a feature request instead of a bug…
An error in an expansion of a whitebox implicit macro will just remove the macro from the list of implicit candidates in the current implicit search, without ever reporting an actual error to the user.
(I have not experimented yet.)
I assume the suggestion about macro settings is to let the user request verbose output from a blackbox macro via echo, instead of using info and expecting it to honor a global -verbose flag.