Bug 22370 – std.concurrency.spawn* should accept noreturn callables

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-10-08T19:06:06Z
Last change time
2021-10-14T18:49:55Z
Keywords
pull
Assigned to
No Owner
Creator
moonlightsentinel

Comments

Comment #0 by moonlightsentinel — 2021-10-08T19:06:06Z
spawn[Linked] currently requires the passed callable to return void. This restriction could be lifted to allow `noreturn` because both imply no actual return value.
Comment #1 by dlang-bot — 2021-10-14T13:12:39Z
@MoonlightSentinel created dlang/phobos pull request #8276 "Fix 22370 - Accept noreturn callables in std.concurrency.spawn[Linked]" fixing this issue: - Fix 22370 - Accept noreturn callables in std.concurrency.spawn[Linked] `spawn[Linked]` required the passed callable to return `void`. This is unecessarily strict because both `void` and `noreturn` imply that no actual value will be returned by the callable. https://github.com/dlang/phobos/pull/8276
Comment #2 by dlang-bot — 2021-10-14T18:49:55Z
dlang/phobos pull request #8276 "Fix 22370 - Accept noreturn callables in std.concurrency.spawn[Linked]" was merged into master: - c644eba3e6f305388217509d903e22ba12c75071 by MoonlightSentinel: Fix 22370 - Accept noreturn callables in std.concurrency.spawn[Linked] `spawn[Linked]` required the passed callable to return `void`. This is unecessarily strict because both `void` and `noreturn` imply that no actual value will be returned by the callable. https://github.com/dlang/phobos/pull/8276