Bug 22368 – has[Unshared]Aliasing fails to instantiate for noreturn

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-10-08T17:21:05Z
Last change time
2021-10-09T09:11:11Z
Keywords
pull
Assigned to
No Owner
Creator
moonlightsentinel

Comments

Comment #0 by moonlightsentinel — 2021-10-08T17:21:05Z
The aliasing traits fail when instantiated with noreturn: ===================================================== import std.traits; static assert(!hasAliasing!noreturn); std\meta.d-mixin-645(645): Error: template instance `F!(__T27RepresentationTypeTupleImplTNnZ)` does not match template declaration `RepresentationTypeTupleImpl(T)` std\traits.d(2871): Error: template instance `std.meta.staticMapMeta!(RepresentationTypeTupleImpl, __T27RepresentationTypeTupleImplTNnZ)` error instantiating std\traits.d(2802): instantiated from here: `RepresentationTypeTupleImpl!(noreturn)` std\traits.d(2896): instantiated from here: `RepresentationTypeTuple!(noreturn)` std\traits.d(3309): instantiated from here: `hasRawAliasing!(noreturn)` core\internal\traits.d(200): ... (1 instantiations, -v to show) ... std\traits.d(3209): instantiated from here: `anySatisfy!(hasAliasingImpl, noreturn)` __stdin.d(2): instantiated from here: `hasAliasing!(noreturn)` __stdin.d(2): while evaluating: `static assert(!hasAliasing!(noreturn))` ===================================================== import std.traits; static assert(!hasUnsharedAliasing!noreturn); std\traits.d(3575): Error: cannot infer type from template instance `pred!(noreturn)`, possible circular dependency core\internal\traits.d(200): Error: template instance `std.traits.pred!(noreturn)` error instantiating std\traits.d(3430): instantiated from here: `anySatisfy!(hasUnsharedAliasingImpl, noreturn)` __stdin.d(2): instantiated from here: `hasUnsharedAliasing!(noreturn)` __stdin.d(2): while evaluating: `static assert(!hasUnsharedAliasing!(noreturn))` =====================================================
Comment #1 by dlang-bot — 2021-10-08T17:25:02Z
@MoonlightSentinel created dlang/phobos pull request #8265 "Fix 22368 - has[Unshared]Aliasing fails to instantiate for noreturn" fixing this issue: - Fix 22368 - has[Unshared]Aliasing fails to instantiate for noreturn The problem was that `noreturn` matched the special case for `Rebindable` because the bottom type is implicitly convertible to any type. https://github.com/dlang/phobos/pull/8265
Comment #2 by dlang-bot — 2021-10-08T19:01:19Z
@MoonlightSentinel created dlang/phobos pull request #8266 "Fix 22369 - Omit unreachable statements in std.concurrency" fixing this issue: - Fix 22368 - has[Unshared]Aliasing fails to instantiate for noreturn The problem was that `noreturn` matched the special case for `Rebindable` because the bottom type is implicitly convertible to any type. https://github.com/dlang/phobos/pull/8266
Comment #3 by dlang-bot — 2021-10-09T09:11:11Z
dlang/phobos pull request #8265 "Fix 22368 - has[Unshared]Aliasing fails to instantiate for noreturn" was merged into master: - b612caa1625aafb79c88e20a24876d8aac8dac7a by MoonlightSentinel: Fix 22368 - has[Unshared]Aliasing fails to instantiate for noreturn The problem was that `noreturn` matched the special case for `Rebindable` because the bottom type is implicitly convertible to any type. https://github.com/dlang/phobos/pull/8265