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

          Issue ID: 21953
           Summary: arrayop accepted on array of noreturn, leading to
                    runtime failure or wrong code
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: accepts-invalid, wrong-code
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

this code is accepted but should not

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

void main()
{
    noreturn[100] a;
    a[] = null;      // rt failure
    // a[55] = null; // Error: cannot implicitly convert expression `null` of
type `typeof(null)` to `noreturn`
}    
---

as the commented expstmt does not pass.

--

Reply via email to