Question about -Wconf discrepancy between scala 2 and scala 3 #18365
-
Both
I'm not sure exactly how "User-defined configurations" is defined, but at least part of the behavior seems to be reversed moving from scala 2 to scala 3. Illustration of what I mean: object Main {
def main(args: Array[String]): Unit = Deprecated.deprecated
}
object Deprecated {
@deprecated("", "")
def deprecated = ()
} Note that
scala 3:
In scala 2, with Was this change intentional? Was it documented anywhere? Or was it an oversight or mistake? I greatly preferred the behavior in scala 2. I could configure global scalac options to be used everywhere, and then in individual places, add additional I would like to file a bug, as the documentation for the behavior remains exactly the same, but the actual behavior has been reversed. Both behaviors could be interpreted as implementing the documentation though, so I thought I'd start a discussion first and see if this change was intentional |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I'm pretty sure your intuition is correct, that both versions should work approximately the same way. The Scala 2 option specifies that it accumulates in Scala 3 options are different, so I could not guess without inspection. Probably you're right that they forgot to reverse. "User config" is as opposed to default config, I assume. So it's handy that "last wins". To veer off-topic, not all options are "last wins." For example, linting respects if a lint is explicitly turned off, even if some other settings want to turn it on. In this case, arguably, if I "silence" or "suppress" a category, I don't want some other config making it an error. (Maybe it's turned on by |
Beta Was this translation helpful? Give feedback.
-
That's fine by me. My use case is that I want to basically do
Thanks for that validation, I'll go ahead and file a bug |
Beta Was this translation helpful? Give feedback.
I'm pretty sure your intuition is correct, that both versions should work approximately the same way.
The Scala 2 option specifies that it accumulates in
prepend
mode, with the semantics that "last config wins" because it winds up first in priority.Scala 3 options are different, so I could not guess without inspection. Probably you're right that they forgot to reverse.
"User config" is as opposed to default config, I assume. So it's handy that "last wins".
To veer off-topic, not all options are "last wins." For example, linting respects if a lint is explicitly turned off, even if some other settings want to turn it on.
In this case, arguably, if I "silence" or "suppress" a category, I do…