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

Scala 2.13 immutable-sequences? #369

Open
yamin-oanda opened this issue Apr 16, 2024 · 2 comments
Open

Scala 2.13 immutable-sequences? #369

yamin-oanda opened this issue Apr 16, 2024 · 2 comments

Comments

@yamin-oanda
Copy link

On https://twitter.github.io/scrooge/CommandLine.html#scrooge-generator

It is instructed:

--language-flag Pass arguments to supported language generators. To generate Scala 2.13 compatible scala.Seq alias as scala.collection.immutable.Seq, please use "immutable-sequences".

However it is not clear how exactly to pass in this command-line argument. According to https://twitter.github.io/scrooge/SBTPlugin.html#scrooge-sbt-configuration-options

scroogeBuildOptions: Seq[String]

list of command-line arguments to pass to scrooge (default: Seq(“WithFinagle”))

However this documentation seems incorrect and it seems to have been a Seq[ServiceOption] for a long time now: 5979724?diff=unified&w=0#diff-83e8daaecab09dbc766048e5ea463929ef92658795f3d8669bacea67d85c2417L20

And ServiceOption is locked down so we can't pass in arbitrary strings like --language-flag immutable-sequences:

abstract sealed class ServiceOption

case object WithFinagle extends ServiceOption
case object WithJavaPassThrough extends ServiceOption
case object WithAsClosable extends ServiceOption {
  val AsClosableMethodName: String = "asClosable"
}

Is there any configuration exposed through sbt that would allow us to pass in the flag?

@GEverding
Copy link

This is really annoying. Any accepted work arounds?

@yamin-oanda
Copy link
Author

I haven't found any automated workaround. Just been adding .toSeq wherever the compiler complains about a type mismatch.

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

No branches or pull requests

2 participants