-
-
Notifications
You must be signed in to change notification settings - Fork 693
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
base: stable
Are you sure you want to change the base?
Correct documentation. #8995
Conversation
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)` ```
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 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 referencesYour 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 locallyIf 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); |
There was a problem hiding this comment.
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);
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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()
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Without the cast recent compilers complain with