docs.scala-lang
docs.scala-lang copied to clipboard
-Yimports documentation entry gives invalid format
The documentation displays usage like -Yimports foo,bar, but if you actually use that format, you get a compile error of bad preamble import foo,bar
It needs to be -Yimports:foo,bar
On 2.13.6
note that this is automatically generated so the fix would need to be upstream; see https://github.com/scala/docs.scala-lang/issues/1711 for context
I was just bitten by this in a different context. After 5-10 mins futzing with a test, I really could not believe it. Some options don't care, I think? about whether it's "colonated", some require or don't allow it. Something has to give. Scala 3 has the same syntax.
I don't remember the context of my previous remark, but I just hit it again.
https://github.com/scala/scala/pull/9982
has a commit to accommodate -release 8 and -release:8, and also effectively backports the same for int-valued settings, which was adjusted for Scala 3.
However, that would not handle splitting on comma -Yimports foo,bar. I can't tell if that is a good idea.
A possible fix would be for multi-valued options to take up to the next dash, -Yimports a b -- etc.
Maybe that is a convention.
The ancient code comment says it's trying to handle mixed options and args, scalac source.scala -Vprint:_, so another path is to nail that down and require options first.