-
Notifications
You must be signed in to change notification settings - Fork 87
Factory.newBuilder returns same instance #337
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
Comments
nice catch! @julienrf wdyt about the proposed fix? |
Thanks @oxbowlakes for the investigation! I agree with the fix you proposed. Would you be interested in submitting a pull request? |
Yes, sure. Is there anything I should read first? |
I think you can just apply the fix in a separate branch, and then open a pull request :) |
So I've cloned the repo, created a branch in my clone and am trying to build it (before I've made any changes) and failing completely. The source compiles, but I cannot get the tests to compile. Is there a chat-channel where I can get some help? Cheers! |
|
I ran |
The PR is here: #338 |
There is a serious bug in the implicit conversion of a generic companion to a
CanBuildFrom
. TheFactory
created from theList
companion incorrectly returns the same instance across calls tonewBuilder
:To demonstrate/reproduce the Issue
Why does this happen?
simpleCBF.apply
takes a by-name parameter, and relies on the fact that each time the parameter is referenced, this results in a new builder. It's therefore important that the input to the method is not captured in a local value.Possible fixes
Change (on line 58 of PackageShared.scala)
To
The text was updated successfully, but these errors were encountered: