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

Some generated code does not compile with -Xfatal-warnings #149

Open
eatkins opened this issue Aug 10, 2020 · 0 comments
Open

Some generated code does not compile with -Xfatal-warnings #149

eatkins opened this issue Aug 10, 2020 · 0 comments

Comments

@eatkins
Copy link

eatkins commented Aug 10, 2020

I generated the following contraband file in sbt:

package sbt.internal

type MiniUpdateConfiguration {
  name: String!
  classpath: [java.io.File]
}
type MiniUpdateReport {
  configs: [MiniUpdateConfiguration]!
}

When I compile after running generateContrabands, I get the following error:

[error] ${BASE}/main/src/main/contraband-scala/sbt/internal/MiniUpdateReport.scala:22:26: private default argument in class MiniUpdateReport is never used                              
[error]   private[this] def copy(configs: Vector[MiniUpdateConfiguration] = configs): MiniUpdateReport = {

If I add another field to MiniUpdateReport, the warnings go away. It looks like maybe the generated code shouldn't use default arguments? I suppose that would require inlining the defaults everywhere in the various with* methods.

I can work around the issue but figured I should report it.

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

1 participant