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

Fix sharedLog assignment. #8995

Merged
merged 4 commits into from
Jul 21, 2024
Merged

Fix sharedLog assignment. #8995

merged 4 commits into from
Jul 21, 2024

Conversation

veelo
Copy link
Contributor

@veelo veelo commented Apr 30, 2024

Without the cast recent compilers complain with

Error: none of the overloads of `sharedLog` are callable using argument types `(FileLogger)`
        Candidates are: `std.logger.core.sharedLog()`
                        `std.logger.core.sharedLog(shared(Logger) logger)`

@dlang-bot
Copy link
Contributor

dlang-bot commented Apr 30, 2024

Thanks for your pull request and interest in making D better, @veelo! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
23487 regression std.experimental.logger assigning FileLogger to sharedLog no longer works

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "stable + phobos#8995"

std/logger/core.d Outdated Show resolved Hide resolved
@veelo veelo marked this pull request as draft May 1, 2024 11:41
@burner burner self-requested a review July 5, 2024 16:00
atilaneves and others added 3 commits July 20, 2024 22:25
Fix Bugzilla 23487 - std.experimental.logger assigning FileLogger to sharedLog no longer works
@veelo veelo marked this pull request as ready for review July 20, 2024 20:43
@veelo
Copy link
Contributor Author

veelo commented Jul 20, 2024

The shared cheats have been moved into the logger implementation by Átila, so that user code can follow proper shared practices, which is now documented.

I noted that stable has entered beta state, let me know if I should rather target master.

@veelo veelo requested a review from thewilsonator July 20, 2024 20:57
@veelo veelo changed the title Correct documentation. Fix sharedLog assignment. Jul 20, 2024
Copy link
Contributor

@thewilsonator thewilsonator left a comment

Choose a reason for hiding this comment

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

Otherwise looks good to me.

std/logger/filelogger.d Show resolved Hide resolved
@thewilsonator thewilsonator merged commit 4b61e7d into dlang:stable Jul 21, 2024
10 checks passed
// we don't need to actually run the code, only make sure
// it compiles
static _() {
auto l = new shared FileLogger("");
Copy link
Member

Choose a reason for hiding this comment

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

what exactly does this test if we assign this to a new variable that should always work anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is @atilaneves ' line, but, as I understand it, it tests that the templated constructor works as a shared constructor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants