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 issue 4957 - std.concurrency rejects structs with Tid #6738

Merged
merged 1 commit into from
Oct 23, 2018

Conversation

Geod24
Copy link
Member

@Geod24 Geod24 commented Oct 22, 2018

In addition to the fix which makes it recurse in struct,
the instantiation was changed to not use recursive template instantiation,
exception for struct's tupleof.

@bithavoc
Copy link

I hope this gets merged, this and https://issues.dlang.org/show_bug.cgi?id=5570 made me feel that Dlang was not stable enough a few years back. I've seen more activity in these bug reports these days, I'm feeling tempted to try Dlang again ☕️ .

@Geod24 Geod24 changed the title Fix 4957: std.concurrency rejects structs with Tid Fix issue 4957: std.concurrency rejects structs with Tid Oct 22, 2018
@dlang-bot
Copy link
Contributor

dlang-bot commented Oct 22, 2018

Thanks for your pull request and interest in making D better, @Geod24! 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 annotated coverage diff directly on GitHub with CodeCov's browser extension
  • 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
4957 normal std.concurrency does not allow to pass Tid in struct fields

Testing this PR locally

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

dub fetch digger
dub run digger -- build "master + phobos#6738"

@AndrejMitrovic
Copy link
Contributor

AndrejMitrovic commented Oct 22, 2018

the instantiation was changed to not use recursive template instantiation

But doesn't the old code short-circuit, and yours does not? Then again maybe the performance is ultimately better because of a lack of recursive template instantiations.. ¯\_(ツ)_/¯

Copy link
Member

@n8sh n8sh left a comment

Choose a reason for hiding this comment

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

Including short-circuiting would be nice, but I'll approve this even without.

@Geod24
Copy link
Member Author

Geod24 commented Oct 23, 2018

Is there a way to short-circuit without recursive instantiation ?

@n8sh
Copy link
Member

n8sh commented Oct 23, 2018

Is there a way to short-circuit without recursive instantiation ?

In my experience you can write doesIt |= ...; if (doesIt) return true; without triggering an unreachable code check.

@Geod24
Copy link
Member Author

Geod24 commented Oct 23, 2018

Don't think this has much influence, because by the time the code is run at CTFE all we have is doesIt |= [true|false] so we're just assigning from a constant. Evaluating the template is what we should really short-circuit, but we can't do that with CTFE.

@n8sh
Copy link
Member

n8sh commented Oct 23, 2018

For the benefit of dlang-bot I edited the commit message to start "Fix Issue 4957" instead of "Fix 4957", but that's been clobbered. Please make that change.

@Geod24 Geod24 changed the title Fix issue 4957: std.concurrency rejects structs with Tid Fix #4957: std.concurrency rejects structs with Tid Oct 23, 2018
@Geod24 Geod24 changed the title Fix #4957: std.concurrency rejects structs with Tid Fix issue 4957 - std.concurrency rejects structs with Tid Oct 23, 2018
@Geod24
Copy link
Member Author

Geod24 commented Oct 23, 2018

I did already, but dlang-bot doesn't seem to realize this.

In addition to the fix which makes it recurse in struct, the
instantiation was changed to not use recursive template instantiation,
exception for struct's tupleof.
@dlang-bot dlang-bot merged commit 23a1a5f into dlang:master Oct 23, 2018
@Geod24 Geod24 deleted the fix-issue-4957 branch October 23, 2018 09:18
@Geod24
Copy link
Member Author

Geod24 commented Oct 23, 2018

@n8sh : Ah, commit message, not PR title. Sorry. Thanks for the fix!

@wilzbach
Copy link
Member

Yep that's needed to aggregate the changelog entries over commit messages

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