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

add some dip1000 attributes #226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WebFreak001
Copy link

No description provided.

@@ -504,7 +504,7 @@ interface EventDriverFiles {
needs to make sure that either `on_read_finish` got called, or
`cancelRead` was called before issuing the next call to `read`.
*/
void write(FileFD file, ulong offset, const(ubyte)[] buffer, IOMode mode, FileIOCallback on_write_finish);
void write(FileFD file, ulong offset, return const(ubyte)[] buffer, IOMode mode, return FileIOCallback on_write_finish);
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be scope instead? What does return mean when there is no return value? I guess I should do more research of what DIP1000 has become by now, but somehow I can't really force myself to do that.

Copy link
Author

@WebFreak001 WebFreak001 Nov 17, 2023

Choose a reason for hiding this comment

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

I think the return means that the parameter is then stored on the this object, aka the lifetime of the this object must be larger than the parameter's lifetime, since we are inside a class, although I haven't verified that.

It does make sense for that is how it works in the constructor and what it means to annotate the function itself as return.

Copy link
Author

Choose a reason for hiding this comment

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

after quick testing, it seems that return and scope on classes is a mess

but at least compilation works without warnings for now lol

@s-ludwig
Copy link
Member

Unfortunately we get some compiler crashes for the older compiler versions with the changes. With a bit of luck, we could just bump the minimum supported version to 2.095.1/1.25.1 and just side step the issue.

There are also some adjustments needed for the win32 build.

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

Successfully merging this pull request may close these issues.

2 participants