Skip to content
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

-Yimports documentation entry gives invalid format #2155

Open
Daenyth opened this issue Aug 11, 2021 · 3 comments
Open

-Yimports documentation entry gives invalid format #2155

Daenyth opened this issue Aug 11, 2021 · 3 comments

Comments

@Daenyth
Copy link

Daenyth commented Aug 11, 2021

Screen Shot 2021-08-11 at 9 25 50 AM

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

@SethTisue
Copy link
Member

note that this is automatically generated so the fix would need to be upstream; see #1711 for context

@som-snytt
Copy link
Contributor

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.

@som-snytt
Copy link
Contributor

som-snytt commented Mar 31, 2022

I don't remember the context of my previous remark, but I just hit it again.

scala/scala#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants