[Issue 24113] New: Eager failure of TypeInfo in _d_newclassT even if not used in -betterC

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Aug 27 07:25:14 UTC 2023


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

          Issue ID: 24113
           Summary: Eager failure of TypeInfo in _d_newclassT even if not
                    used in -betterC
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: alphaglosined at gmail.com

Linux Mint 21.2, dmd 2.105. This works on dmd with dmd 2.105-beta1

```
/usr/include/dmd/druntime/import/core/lifetime.d(2761,42): Error: `TypeInfo`
cannot be used with -betterC
```

This corresponds to the function ``_d_newclassT``.

It seems ``_d_newclassT`` is imported by object.d via

```d
public import core.lifetime : _d_newitemT;
```

Versioning out the import from object.d stops this error. This is rather
curious as classes should generate a different error if it were used and that
hook function is templated.

Replacing it with a deprecated function, results in no deprecations.

--


More information about the Digitalmars-d-bugs mailing list