SI-9246 *OrElse should have a by-name parameter#4285
SI-9246 *OrElse should have a by-name parameter#4285193s wants to merge 1 commit intoscala:2.12.xfrom
Conversation
|
No worries, @193s! Thank you for your contribution. It looks like the publish-core task discovered an issue with this submission: |
|
I fixed! Thank you, @adriaanm! |
|
Great! You may ignore the IDE failure (#4287 has been merged to ignore it). The test failure is because this PR introduces a binary incompatible change in an API used by partest, which is compiled separately: scala/scala-partest. |
There was a problem hiding this comment.
I think I suggested this before, but for completeness, convert all the API that correspond to Option, including envOrSome. And scalaPropOrElse?
There was a problem hiding this comment.
Oh, I didn't noticed scalaPropOrElse, thank you.
|
Interestingly, I wonder if a test rig could have the feature that it can demonstrate that it is still testing something. A proof that the predicate being asserted is still meaningful after all these years. edit (by lrytz): the test is extended in #4372 |
|
@adriaanm any ideas how we could push the change through (see your earlier comment)? i don't see a good way to keep the old signatures in the bytecode. we could add overloads but then the compiler would pick the strict version, so the change would be pointless. See #4297 for a similar problem. @193s could you squash the three commits into one? (on your branch, run |
fix scala#4285 compile error; integrate pr scala#4285
|
@lrytz I did as you said, thanks! |
|
I think we can consider it a bug that the old *OrElse methods were eager, so we should fix that in 2.12. It seems unlikely that someone would expect eagerness here, or that these methods would be used in a performance hot spot. Let's add a deprecation message in 2.11 that says these methods will become call by name. The commit message of this PR should also explain why we made the change. |
|
@adriaanm agreed, but my question was about the testing infrastructure: how can we get a green build, given that partest links against the old signature? @193s thanks for the squash! as suggested by Adriaan, could you provide a bit more detail in the commit message? I created a ticket (https://issues.scala-lang.org/browse/SI-9246), so you can refer to that. See here for a lengthy description about commit messages: https://github.com/scala/scala/wiki/Pull-Request-Policy |
The `*OrElse` methods in `scala.tools.reflect.WrappedProperties` and `scala.util.Properties` should have a by-name parameter
|
@193s looks good, thanks! Now you just have to be patient until we figure out how to get our test infrastructure working. |
|
We'll have to release a new version of partest that uses reflection for one minor release I guess. Or that doesn't use the methods that break bin compat. |
|
I bet no one would notice if you sucked the partest module back into scala during lunch hour today. There wouldn't be even the slightest dip in the community contribution rate, either. |
|
True, but I'd rather not eat lunch than re-ingest that module. Completely agreed the partest burden should not be on the contributor, though. |
To enable scala#4285
|
Hi, once #4419 is merged, please |
Enable #4285: switch to partest 1.0.6
|
I've opened a new PR that does the rebase. I'll close this one. Thanks again for your contribution & patience ;-) |
reopen #4279 💎
Sorry for the trouble.