Skip to content

Conversation

@jackkoenig
Copy link
Contributor

You can see the failures in #5028

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?
  • Did you add appropriate documentation in docs/src?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • Bugfix

Marked No Release Notes because this binary compatibility issue is not yet released.

Desired Merge Strategy

  • Squash

Release Notes

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels? (Select the most appropriate one based on the "Type of Improvement")
  • Did you mark the proper milestone (Bug fix: 3.6.x, 5.x, or 6.x depending on impact, API modification or big change: 7.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you do one of the following when ready to merge:
    • Squash: You/ the contributor Enable auto-merge (squash) and clean up the commit message.
    • Merge: Ensure that contributor has cleaned up their commit history, then merge with Create a merge commit.

@jackkoenig jackkoenig added the No Release Notes Exclude from release notes, consider using Internal instead label Sep 19, 2025
updateUnsetFirtoolOptions = identity,
updateUnsetCommonSettings = identity,
updateUnsetBackendSettings = identity
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm actually surprised this works, since the full def flag below has default arguments for everything but name and help I would assume there's an ambiguity issue. Maybe it only materializes if you try to call this method?

I did test that by adding addOption(CliOption.flag("foo", "bar")) to trait EmitVcd, but that didn't trip it. So I guess we go with it? Another option is to make this package private so it only exists for binary compatibility reasons but you can't call it.

Anyway like I said, a little surprised this works, might dig a little bit more tomorrow to understand why.

Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

This generally looks good. I had something similar originally, but it wouldn't compile with Scala 3 (I think?). I had to back out the default options.

@jackkoenig jackkoenig force-pushed the jackkoenig/fix-bincompat branch from 011a80d to 95dc32e Compare September 20, 2025 18:17
@jackkoenig
Copy link
Contributor Author

This generally looks good. I had something similar originally, but it wouldn't compile with Scala 3 (I think?). I had to back out the default options.

I figured it out, whereas Scala 2 won't generate a copy method if you have any copy method, Scala 3 will still generate one unless the copy method has the exact arguments. So the solution is to implement a private version with the correct arguments.

I also made the constructor private to help reduce impact of adding any more arguments.

Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

Nice. Thanks for figuring this out, Jack.

@jackkoenig jackkoenig merged commit 37789a0 into main Sep 21, 2025
15 checks passed
@jackkoenig jackkoenig deleted the jackkoenig/fix-bincompat branch September 21, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No Release Notes Exclude from release notes, consider using Internal instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants