Skip to content

Include private members in API hash of traits.#2160

Merged
eed3si9n merged 2 commits intosbt:0.13from
Duhemm:fix-2155
Aug 17, 2015
Merged

Include private members in API hash of traits.#2160
eed3si9n merged 2 commits intosbt:0.13from
Duhemm:fix-2155

Conversation

@Duhemm
Copy link
Contributor

@Duhemm Duhemm commented Aug 17, 2015

During compilation, scalac generates getters and setters for the fields
of traits, regardless of their access modifiers. Therefore, when a
field of a trait is modified, all its implementors must be recompiled to
take these changes into account.

Private fields of traits were not included in the API hash of traits,
and their implementors were thus not recompiled when modified.

This commit changes the way the API hash is computed for traits only, so
that the generated hash includes the private members of traits.

Fixes #2155

During compilation, scalac generates getters and setters for the fields
of traits, regardless of their access modifiers. Therefore, when a
field of a trait is modified, all its implementors must be recompiled to
take these changes into account.

Private fields of traits were not included in the API hash of traits,
and their implementors were thus not recompiled when modified.

This commit changes the way the API hash is computed for traits only, so
that the generated hash includes the private members of traits.

Fixes sbt#2155
@eed3si9n eed3si9n added the ready label Aug 17, 2015
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that count as a breakage of the binary compatibility?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try the overload, and deprecate the old one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eed3si9n Done

@typesafe-tools
Copy link

Can one of the admins verify this patch?

@eed3si9n
Copy link
Member

LGTM

eed3si9n added a commit that referenced this pull request Aug 17, 2015
Include private members in API hash of traits.
@eed3si9n eed3si9n merged commit 53ef1c5 into sbt:0.13 Aug 17, 2015
@eed3si9n eed3si9n removed the ready label Aug 17, 2015
@dwijnand
Copy link
Member

Nice!

@indrajitr
Copy link
Member

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