Skip to content

Adds withIncludeSynthToNameHashing.#2540

Merged
eed3si9n merged 3 commits intosbt:0.13from
eed3si9n:wip/synthetic
Apr 6, 2016
Merged

Adds withIncludeSynthToNameHashing.#2540
eed3si9n merged 3 commits intosbt:0.13from
eed3si9n:wip/synthetic

Conversation

@eed3si9n
Copy link
Member

@eed3si9n eed3si9n commented Apr 6, 2016

Provides a workaround flag

incOptions := incOptions.value.withIncludeSynthToNameHashing(true)

for name hashing
not including synthetic methods. This will not be enabled by default in
sbt 0.13. It can also enabled by passing sbt.inc.include_synth=true
to JVM. Ref #2537

/review @Duhemm, @gkossakowski, @dwijnand

eed3si9n added 2 commits April 5, 2016 22:52
Provides a workaround flag `incOptions :=
incOptions.value.withIncludeSynthToNameHashing(true)` for name hashing
not including synthetic methods. This will not be enabled by default in
sbt 0.13. It can also enabled by passing `sbt.inc.include_synth=true`
to JVM.
@eed3si9n eed3si9n changed the title Adds withIncludeSynthToNameHashing. Adds withIncludeSynthToNameHashing. Apr 6, 2016
@gkossakowski
Copy link
Contributor

Fails with:

[error] /home/travis/build/sbt/sbt/interface/src/test/scala/xsbti/TestCallback.scala:8: class TestCallback needs to be abstract, since method includeSynthToNameHashing in trait AnalysisCallback of type ()Boolean is not defined
[error] class TestCallback(override val nameHashing: Boolean = false) extends AnalysisCallback
[error]       ^
[error] one error found

Assuming this error is fixed, this looks good to me.

@eed3si9n, I'm wondering if we could always include synthetic names. I haven't found a good reason to not to include them. What do you think?

@eed3si9n
Copy link
Member Author

eed3si9n commented Apr 6, 2016

@gkossakowski I can flip the switch and have it on by default. I thought we are concerned that changing apply could cascade into compiling all sources because everyone uses apply.

@mpociecha
Copy link

So maybe does it make sense to add the possibility to specify the list of names which won't be included? It would be only the half-measure, I think, but it anyway may be worth to have it for the test purposes.

@eed3si9n
Copy link
Member Author

eed3si9n commented Apr 6, 2016

@mpociecha For now let's keep it simple on or off, and we can fine tune this more in sbt/zinc for 1.0, which will have synthetic methods included by default.

@eed3si9n eed3si9n merged commit ba72faa into sbt:0.13 Apr 6, 2016
@eed3si9n eed3si9n deleted the wip/synthetic branch April 6, 2016 17:49
@smarter
Copy link
Contributor

smarter commented Apr 26, 2016

Note that including synthetic members is not enough, you should also include synthetic classes (which are currently ignored), consider:

case class A(x: Int)
// private object A
object B {
  A(0) // should stop compiling when the private object line is uncommented
}

@eed3si9n eed3si9n mentioned this pull request May 1, 2016
7 tasks
@dwijnand
Copy link
Member

dwijnand commented Sep 6, 2016

Forward port in sbt/zinc#110, with a breaking change for 1.0.

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

Successfully merging this pull request may close these issues.

5 participants