[Scala3] [bugfix] BundlePhase: skip cloning by-name Bundle params#5372
Merged
adkian-sifive merged 1 commit intoMay 20, 2026
Merged
Conversation
Move DataEqualitySpec that was blocked on this
jackkoenig
approved these changes
May 20, 2026
Comment on lines
+106
to
+111
| // Skip cloning for by-name params: ExprType(T).baseClasses includes | ||
| // T's parents, so isData would return true for a by-name Data, | ||
| // but the by-name accessor returns the underlying value, which the | ||
| // constructor expects as a Function0 (after ElimByName). Cloning would | ||
| // try to feed a Data where a Function0 is expected. | ||
| val isByName = paramSym.info.isInstanceOf[ExprType] |
Contributor
There was a problem hiding this comment.
An .isInstanceOf check feels like a weird way to check for this, is there no better way? Some method or utility function call?
A nit, so see if there's a better way but feel free to merge if not.
Member
Author
There was a problem hiding this comment.
Claude thinks this is the cleanest..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix bug in BundlePhase which was incorrectly cloning by-name constructor parameters by adding special handling parameters. This matches the Scala 2 plugin which uses
sym.tpe <:< dataTpethat correctly skips cloning by-name params. Move DataEqualitySpec that was failing because of thisRelease Notes
Fix bug in Scala 3 BundlePhase in handling by-name parameters in Bundles
Development notes