[Issue 21955] New: CastExp of noreturn is detected too late

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 23 03:33:01 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21955

          Issue ID: 21955
           Summary: CastExp of noreturn is detected too late
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: ice
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: b2.temp at gmx.com

this code is rejected with an error in the backend, it should be a front-end
error instead.

---
alias noreturn = typeof(*null);

int main()
{
    noreturn a;
    auto c = cast(int) a;
    return 0;
} 
---

> /tmp/temp_7F9C4DB5BA30.d:8:24: Error: e2ir: cannot cast `a` of type `noreturn` to type `int`


DMD git 9d718f2f8c7f34d3b616791493d9e71d7527f221

--


More information about the Digitalmars-d-bugs mailing list