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

Correct documentation. #8995

Draft
wants to merge 1 commit into
base: stable
Choose a base branch
from
Draft

Correct documentation. #8995

wants to merge 1 commit into from

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)`

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

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

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

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"

@@ -1433,7 +1433,7 @@ logger by the user, the default logger's log level is LogLevel.info.

Example:
-------------
sharedLog = new FileLogger(yourFile);
sharedLog = cast(shared) new FileLogger(yourFile);
Copy link
Contributor

Choose a reason for hiding this comment

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

should this not be sharedLog = new shared(FileLogger)(yourFile);?

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 would think so too, but that produces

Error: none of the overloads of `__ctor` are callable using a `shared` object
C:\D\dmd2\windows\bin64\..\..\src\phobos\std\logger\filelogger.d(40,5):        Candidates are: `std.logger.filelogger.FileLogger.this(const(string) fn, const(LogLevel) lv = LogLevel.all)`
C:\D\dmd2\windows\bin64\..\..\src\phobos\std\logger\filelogger.d(66,5):                        `std.logger.filelogger.FileLogger.this(const(string) fn, const(LogLevel) lv, Flag createFileNameFolder)`
C:\D\dmd2\windows\bin64\..\..\src\phobos\std\logger\filelogger.d(105,5):                        `std.logger.filelogger.FileLogger.this(File file, const(LogLevel) lv = LogLevel.all)`

I have found zero documentation on creating shared instances.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should there have been a shared this()?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, no shared constructor. That would also solve the problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, that would be a better solution. The example should also be a unittest. I'll see if I can find time to correct this.

@veelo veelo marked this pull request as draft May 1, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants