Bug 22373 – Glue layer rejects cast from noreturn to other type

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-10-09T23:40:38Z
Last change time
2021-10-10T23:13:23Z
Keywords
pull
Assigned to
No Owner
Creator
moonlightsentinel

Comments

Comment #0 by moonlightsentinel — 2021-10-09T23:40:38Z
Example: ================================= void cast_() { noreturn n; int i = n; } ================================= example.d(4): Error: e2ir: cannot cast `n` of type `noreturn` to type `int`
Comment #1 by dlang-bot — 2021-10-09T23:47:34Z
@MoonlightSentinel created dlang/dmd pull request #13144 "Fix 22373 - Handle casts from noreturn in e2ir.d " fixing this issue: - Fix 22373 - Handle casts from noreturn in e2ir.d Ignore the cast and only emit the `noreturn` expression - which will abort / throw and hence never reach the cast. https://github.com/dlang/dmd/pull/13144
Comment #2 by dlang-bot — 2021-10-10T00:37:16Z
dlang/dmd pull request #13144 "Fix 22373 - Handle casts from noreturn in e2ir.d " was merged into stable: - f22d1b05c7e7de5b5e17d3297c718673f167e5c2 by MoonlightSentinel: Fix 22373 - Handle casts from noreturn in e2ir.d Ignore the cast and only emit the `noreturn` expression - which will abort / throw and hence never reach the cast. https://github.com/dlang/dmd/pull/13144
Comment #3 by dlang-bot — 2021-10-10T23:13:23Z
dlang/dmd pull request #13149 "merge stable" was merged into master: - 6f0fc97dffa0745af1b2f39a8a7022c8afd69e57 by MoonlightSentinel: Fix 22373 - Handle casts from noreturn in e2ir.d Ignore the cast and only emit the `noreturn` expression - which will abort / throw and hence never reach the cast. https://github.com/dlang/dmd/pull/13149