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

Tweak Bundle._elementsImpl #2390

Merged
merged 3 commits into from
Feb 3, 2022
Merged

Tweak Bundle._elementsImpl #2390

merged 3 commits into from
Feb 3, 2022

Conversation

jackkoenig
Copy link
Contributor

@jackkoenig jackkoenig commented Feb 3, 2022

  • Change type of Bundle._elementsImpl to Iterable

It was previously SeqMap (ListMap on Scala 2.12). This change gives us
more freedom to optimize the implementation without breaking binary
compatibility. It is scala.collection.Iterable because it is perfectly
fine to return mutable collections (like Arrays) since the only use is
to Iterate on them.

  • Disallow users implementing Bundle._elementsImpl

Currently, it would result in a runtime linkage error. This turns it
into a compile-time error.

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • [NA] Did you add appropriate documentation in docs/src?
  • Did you state the API impact?
  • Did you specify the code generation impact?
  • Did you request a desired merge strategy?
  • [NA] Did you add text to be included in the Release Notes for this change?

Tweak to unreleased feature, no release notes necessary

Type of Improvement

  • code refactoring

API Impact

This widens the type of Bundle._elementsImpl to Iterable so that we can be more flexible in the future without breaking binary compatibility. Technically user visible because _elementsImpl is protected, but if they were to override it they would previously have gotten a runtime linkage error and with this PR they will get a compile-time error.

Backend Code Generation Impact

None

Desired Merge Strategy

  • Squash

Release Notes

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (Bug fix: 3.4.x, [small] API extension: 3.5.x, API modification or big change: 3.6.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you mark as Please Merge?

It was previously SeqMap (ListMap on Scala 2.12). This change gives us
more freedom to optimize the implementation without breaking binary
compatibility. It is scala.collection.Iterable because it is perfectly
fine to return mutable collections (like Arrays) since the only use is
to Iterate on them.
Currently, it would result in a runtime linkage error. This turns it
into a compile-time error.
@jackkoenig jackkoenig added this to the 3.5.x milestone Feb 3, 2022
Copy link
Contributor

@chick chick left a comment

Choose a reason for hiding this comment

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

That looks pretty simple and clean.
Approved

@jackkoenig jackkoenig added the Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI. label Feb 3, 2022
@mergify mergify bot merged commit 1b05a14 into master Feb 3, 2022
@mergify mergify bot deleted the tweak-bundle-elementsImpl branch February 3, 2022 03:22
mergify bot pushed a commit that referenced this pull request Feb 3, 2022
* Change type of Bundle._elementsImpl to Iterable

It was previously SeqMap (ListMap on Scala 2.12). This change gives us
more freedom to optimize the implementation without breaking binary
compatibility. It is scala.collection.Iterable because it is perfectly
fine to return mutable collections (like Arrays) since the only use is
to Iterate on them.

* Disallow users implementing Bundle._elementsImpl

Currently, it would result in a runtime linkage error. This turns it
into a compile-time error.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 1b05a14)
@mergify mergify bot added the Backported This PR has been backported label Feb 3, 2022
mergify bot added a commit that referenced this pull request Feb 3, 2022
* Change type of Bundle._elementsImpl to Iterable

It was previously SeqMap (ListMap on Scala 2.12). This change gives us
more freedom to optimize the implementation without breaking binary
compatibility. It is scala.collection.Iterable because it is perfectly
fine to return mutable collections (like Arrays) since the only use is
to Iterate on them.

* Disallow users implementing Bundle._elementsImpl

Currently, it would result in a runtime linkage error. This turns it
into a compile-time error.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 1b05a14)

Co-authored-by: Jack Koenig <koenig@sifive.com>
jackkoenig pushed a commit that referenced this pull request Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported This PR has been backported Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants