www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23986] New: ICE: dip1021 asserts on `typeof(null)` parameter

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

          Issue ID: 23986
           Summary: ICE: dip1021 asserts on `typeof(null)` parameter
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dkorpel live.nl

```
// REQUIRED_ARGS: -preview=dip1021 -o-
 safe:

void f(typeof(null) obj, int* x) {}

void g()
{
    f(null, null);
}
```

Hits the `default: assert(0)` in dmd.escape.isReferenceToMutable, because it
doesn't have a case for `Tnull`.

--
Jun 10 2023